Преглед изворни кода

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

wangxiaoming пре 7 година
родитељ
комит
594e392cf4
17 измењених фајлова са 759 додато и 110 уклоњено
  1. 19 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerInfo.java
  2. 56 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/customer/LowestPriceInfo.java
  3. 16 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/customer/CustomerBasicService.java
  4. 18 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml
  5. 10 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/customer/CustomerBasicServiceImpl.java
  6. 16 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.java
  7. 47 6
      watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.xml
  8. 42 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/customer/CustomerBasicController.java
  9. 1 0
      watero-rst-web/src/main/resources/watero-rst-orm.xml
  10. 197 22
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl
  11. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/order_list.ftl
  12. 155 25
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_customer.ftl
  13. 10 3
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/salesOrder/sales_order_list.ftl
  14. 9 9
      watero-rst-web/src/main/webapp/WEB-INF/views/customer/custome_basic_detail.ftl
  15. 50 10
      watero-rst-web/src/main/webapp/WEB-INF/views/customer/save_customer_info.ftl
  16. 45 6
      watero-rst-web/src/main/webapp/WEB-INF/views/customer/update_customer_info.ftl
  17. 67 23
      watero-rst-web/src/main/webapp/common/js/customer/customer.js

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

@@ -139,6 +139,9 @@ public class CustomerInfo  implements Serializable {
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
     private Date endTime;   //结束时间
+    private Integer customerLastId;//上次客诉id
+    private Integer customerInitialId;//初始客诉id
+
 
     public void setComplaintDetectList(List<ComplaintDetectInfo> complaintDetectList) {
         this.complaintDetectList = complaintDetectList;
@@ -671,4 +674,20 @@ public class CustomerInfo  implements Serializable {
     public void setCustomerSecondaryCustomer(String customerSecondaryCustomer) {
         this.customerSecondaryCustomer = customerSecondaryCustomer;
     }
+
+    public Integer getCustomerLastId() {
+        return customerLastId;
+    }
+
+    public void setCustomerLastId(Integer customerLastId) {
+        this.customerLastId = customerLastId;
+    }
+
+    public Integer getCustomerInitialId() {
+        return customerInitialId;
+    }
+
+    public void setCustomerInitialId(Integer customerInitialId) {
+        this.customerInitialId = customerInitialId;
+    }
 }

+ 56 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/customer/LowestPriceInfo.java

@@ -0,0 +1,56 @@
+package com.iamberry.rst.core.customer;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by Administrator on 2018/5/15.
+ */
+public class LowestPriceInfo implements Serializable {
+    private static final long serialVersionUID = -8005905099621784835L;
+    private Integer lowestPriceId;//
+    private Integer productId;
+    private Integer channelDivisionId;
+    private Integer lowestPrice;
+    private Date createDate;
+
+    public Integer getLowestPriceId() {
+        return lowestPriceId;
+    }
+
+    public void setLowestPriceId(Integer lowestPriceId) {
+        this.lowestPriceId = lowestPriceId;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getChannelDivisionId() {
+        return channelDivisionId;
+    }
+
+    public void setChannelDivisionId(Integer channelDivisionId) {
+        this.channelDivisionId = channelDivisionId;
+    }
+
+    public Integer getLowestPrice() {
+        return lowestPrice;
+    }
+
+    public void setLowestPrice(Integer lowestPrice) {
+        this.lowestPrice = lowestPrice;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+}

+ 16 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/customer/CustomerBasicService.java

@@ -1,6 +1,8 @@
 package com.iamberry.rst.faces.customer;
 
 import com.iamberry.rst.core.address.City;
+import com.iamberry.rst.core.address.Country;
+import com.iamberry.rst.core.address.District;
 import com.iamberry.rst.core.address.Province;
 import com.iamberry.rst.core.customer.*;
 import com.iamberry.rst.core.order.Product;
@@ -120,6 +122,12 @@ public interface CustomerBasicService {
     public List<City> queryCityList(String provinceId);
 
     /**
+     * 根据城市代号查询所有区/县
+     * @param cityId
+     * @return
+     */
+    public List<District> queryDistrictList(String cityId);
+    /**
      * 查询所有渠道类别
      * @param channelCategoryId
      * @return
@@ -217,4 +225,12 @@ public interface CustomerBasicService {
      */
     Integer deleteDivisionInfo(Integer channelDivisionId);
 
+    /**
+     * 获取产品最低价格信息
+     * @param lowestPriceInfo
+     * @return
+     */
+    LowestPriceInfo getLowestPrice(LowestPriceInfo lowestPriceInfo);
+
+
 }

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

@@ -56,7 +56,9 @@
       t.customer_question_title,
       t.customer_desc,
       t.customer_out_damaged,
-      t.customer_secondary_customer
+      t.customer_secondary_customer,
+      t.customer_last_id,
+      t.customer_initial_id
     from tb_rst_customer_info t
     where t.customer_id = #{customerId,jdbcType=INTEGER}
   </select>
@@ -92,6 +94,8 @@
       c.customer_desc,
       c.customer_out_damaged,
       c.customer_secondary_customer,
+      c.customer_last_id,
+      c.customer_initial_id,
       v.visit_status,
       v.visit_complete_date,
       v.visit_name,
@@ -255,6 +259,8 @@
     <result column="customer_desc" property="customerDesc"/>
     <result column="customer_out_damaged" property="customerOutDamaged"/>
     <result column="customer_secondary_customer" property="customerSecondaryCustomer"/>
+    <result column="customer_last_id" property="customerLastId"/>
+    <result column="customer_initial_id " property="customerInitialId"/>
     <result column="visit_status" property="visitStatus"/>
     <result column="visit_complete_date" property="visitCompleteDate"/>
     <result column="visit_name" property="visitName"/>
@@ -283,13 +289,14 @@
       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_in_TDS, customer_out_TDS, customer_area, type_id, customer_desc, customer_out_damaged, customer_secondary_customer, customer_last_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}
       )
   </insert>
 
@@ -358,7 +365,13 @@
         customer_out_damaged = #{customerOutDamaged},
       </if>
       <if test="customerSecondaryCustomer != null" >
-        customer_secondary_customer = #{customerSecondaryCustomer}
+        customer_secondary_customer = #{customerSecondaryCustomer},
+      </if>
+      <if test="customerLastId != null" >
+        customer_last_id = #{customerLastId},
+      </if>
+      <if test="customerInitialId != null" >
+        customer_initial_id = #{customerInitialId}
       </if>
     </set>
     where customer_id = #{customerId}
@@ -418,6 +431,8 @@
     c.customer_desc,
     c.customer_out_damaged,
     c.customer_secondary_customer,
+    c.customer_last_id,
+    c.customer_initial_id,
     v.visit_status,
     v.visit_complete_date,
     v.visit_name,

+ 10 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/CustomerBasicServiceImpl.java

@@ -2,6 +2,8 @@ package com.iamberry.rst.service.customer;
 
 import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.address.City;
+
+import com.iamberry.rst.core.address.District;
 import com.iamberry.rst.core.address.Province;
 import com.iamberry.rst.core.customer.*;
 import com.iamberry.rst.core.order.Product;
@@ -236,7 +238,9 @@ public class CustomerBasicServiceImpl implements CustomerBasicService{
     public List<City> queryCityList(String provinceId){
         return (List<City>)customerBasicMapper.queryCityList(provinceId);
     }
-
+    public List<District> queryDistrictList(String cityId){
+        return (List<District>)customerBasicMapper.queryDistrictList(cityId);
+    }
     public List<ChannelDivisionInfo> queryChannelCategoryList(String channelCategoryId){
         return (List<ChannelDivisionInfo>)customerBasicMapper.queryChannelCategoryList(channelCategoryId);
     }
@@ -301,6 +305,11 @@ public class CustomerBasicServiceImpl implements CustomerBasicService{
     public Integer deleteDivisionInfo(Integer channelDivisionId) {
         return customerBasicMapper.deleteDivisionInfo(channelDivisionId);
     }
+
+    @Override
+    public LowestPriceInfo getLowestPrice(LowestPriceInfo lowestPriceInfo) {
+        return customerBasicMapper.getLowestPrice(lowestPriceInfo);
+    }
     /*@Override
     public void saveDockedContactInfo(DockedContactInfo dockedContactInfo) {
         customerBasicInfoSaveMapper.saveDockedContactInfo(dockedContactInfo);

+ 16 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.java

@@ -1,6 +1,7 @@
 package com.iamberry.rst.service.customer.mapper;
 
 import com.iamberry.rst.core.address.City;
+import com.iamberry.rst.core.address.District;
 import com.iamberry.rst.core.address.Province;
 import com.iamberry.rst.core.customer.*;
 import com.iamberry.rst.core.order.Product;
@@ -126,7 +127,12 @@ public interface CustomerBasicMapper {
      * @return
      */
     public List<City> queryCityList(String provinceId);
-
+    /**
+     * 根据城市代号查询所有区/县
+     * @param cityId
+     * @return
+     */
+    public List<District> queryDistrictList(String cityId);
     /**
      * 查询所有渠道类别
      * @param channelCategoryId
@@ -199,4 +205,13 @@ public interface CustomerBasicMapper {
      * @return
      */
     String queryIsExsitChannelNameChannelName(ChannelSaleInfo channelSaleInfo);
+
+    /**
+     * 获取产品最低价格信息
+     * @param lowestPriceInfo
+     * @return
+     */
+    LowestPriceInfo getLowestPrice(LowestPriceInfo lowestPriceInfo);
+
+
 }

+ 47 - 6
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.xml

@@ -291,6 +291,13 @@
         <result property="city" column="city" />
         <!--<result property="provinceNum" column="provinceid" />-->
     </resultMap>
+    <!--根据城市代号查询所有区/县映射-->
+    <resultMap type="com.iamberry.rst.core.address.District" id="queryDistrictResult">
+        <id property="districtId" column="district_id"/>
+        <!--<result property="cityNum" column="city_number" />-->
+        <result property="district" column="district" />
+        <!--<result property="provinceNum" column="provinceid" />-->
+    </resultMap>
     <!--查询所有渠道类别-->
     <resultMap type="com.iamberry.rst.core.customer.ChannelDivisionInfo" id="queryChannelCategoryResult">
         <result property="channelCategory" column="channel_category" />
@@ -309,8 +316,8 @@
     </resultMap>
     <!--查询销售产品价格-->
     <resultMap type="com.iamberry.rst.core.order.ProductColor" id="querySupplyPriceResult">
-        <result property="colorId" column="color_id" />
-        <result property="colorPrice" column="color_price" />
+        <result property="colorId" column="supply_product_id" />
+        <result property="colorPrice" column="supply_product_price" />
     </resultMap>
     <!--映射结果集 end-->
 
@@ -505,6 +512,19 @@
         ORDER BY
         t.city_id ASC
     </select>
+    <!--根据省份代号查询所有区/县-->
+    <select id="queryDistrictList" parameterType="java.lang.String" resultMap="queryDistrictResult">
+        SELECT
+        t.district_id,
+        t.district,
+        t.division_code
+        FROM
+        tb_rst_address_district t
+        WHERE
+        t.city_id = #{id}
+        ORDER BY
+        t.district_id ASC
+    </select>
     <!--查询所有渠道类别-->
     <select id="queryChannelCategoryList" parameterType="java.lang.String" resultMap="queryChannelCategoryResult">
         SELECT
@@ -545,12 +565,13 @@
         t.product_name
         FROM
         tb_rst_product_info t
+        WHERE
+        t.product_wholesale = '1'
         ORDER BY
         t.product_id ASC
     </select>
     <!--查询销售产品价格-->
-    <select id="querySupplyPriceList" parameterType="java.lang.String" resultMap="querySupplyPriceResult">
-        SELECT
+    <!--   /*SELECT
         t.color_id,
         t.color_price
         FROM
@@ -558,7 +579,19 @@
         WHERE
         t.color_product_id = #{id}
         ORDER BY
-        t.color_id ASC
+        t.color_id ASC*/-->
+    <select id="querySupplyPriceList" parameterType="java.lang.String" resultMap="querySupplyPriceResult">
+        SELECT
+        t.supply_product_id,
+        t.supply_product_price
+        FROM
+        tb_rst_supply_product_info t
+        WHERE
+        t.supply_product_id = #{id}
+        AND
+        t.supply_price_status = '1'
+        ORDER BY
+        t.supply_product_id ASC
     </select>
 
     <update id="updateCustomerBasic" parameterType="CustomerBasicInfo">
@@ -625,7 +658,7 @@
 
     <update id="updateOpeningInfo" parameterType="TicketOpeningInfo">
         UPDATE tb_rst_ticket_opening_info
-        <set >
+        <set>
             <if test="ticketType != null and ticketType !='' " >
                 ticket_type = #{ticketType},
             </if>
@@ -660,4 +693,12 @@
     <delete id="deleteDivisionInfo" parameterType="Integer">
         DELETE FROM tb_rst_channel_division_info WHERE channel_division_id = #{channelDivisionId}
     </delete>
+
+    <select id="getLowestPrice" parameterType="LowestPriceInfo" resultType="LowestPriceInfo">
+      select * from tb_rst_lowest_price_info
+      where
+      product_id = #{productId}
+      AND
+      channel_division_id = #{channelDivisionId}
+    </select>
 </mapper>

+ 42 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/customer/CustomerBasicController.java

@@ -1,6 +1,7 @@
 package com.iamberry.rst.controllers.customer;
 
 import com.iamberry.rst.core.address.City;
+import com.iamberry.rst.core.address.District;
 import com.iamberry.rst.core.address.Province;
 import com.iamberry.rst.core.customer.*;
 import com.iamberry.rst.core.order.Product;
@@ -440,6 +441,27 @@ public class CustomerBasicController {
     }
 
     /**
+     * 根据省份代号查询所有区/县
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/query_districtList")
+    public ResponseJson queryDistrictList(HttpServletRequest request) {
+        //Province province = new Province();
+        String cityId =  request.getParameter("cityId");
+        List<District> districtList = null;
+        districtList = customerBasicService.queryDistrictList(cityId);
+        if (districtList != null || districtList.size() > 0) {
+            ResponseJson rj =new ResponseJson(200, "查询成功", 200);
+            rj.addResponseKeyValue("districtList", districtList);
+            return rj;
+        } else {
+            return new ResponseJson(500, "查询失败", 500);
+        }
+    }
+
+    /**
      * 查询所有渠道类别
      *
      * @return
@@ -532,4 +554,24 @@ public class CustomerBasicController {
         }
         return rj;
     }
+
+    /**
+     * 根据销售产品id和渠道id查询最低价
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/getLowestPrice")
+    public ResponseJson getLowestPrice(HttpServletRequest request,LowestPriceInfo lowestPriceInfo) {
+        if(lowestPriceInfo != null){
+            lowestPriceInfo = customerBasicService.getLowestPrice(lowestPriceInfo);
+        }
+        if (lowestPriceInfo != null) {
+            ResponseJson rj =new ResponseJson(200, "查询成功", 200);
+            rj.addResponseKeyValue("lowestPriceInfo", lowestPriceInfo);
+            return rj;
+        } else {
+            return new ResponseJson(500, "查询失败", 500);
+        }
+    }
 }

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

@@ -99,6 +99,7 @@
 		<typeAlias type="com.iamberry.rst.core.customer.CustomerBasicInfo" alias="CustomerBasicInfo"/>
 		<typeAlias type="com.iamberry.rst.core.customer.DockedContactInfo" alias="DockedContactInfo"/>
 		<typeAlias type="com.iamberry.rst.core.customer.TicketOpeningInfo" alias="TicketOpeningInfo"/>
+		<typeAlias type="com.iamberry.rst.core.customer.LowestPriceInfo" alias="LowestPriceInfo"/>
 	</typeAliases>
 	<!-- PageHelper -->
 	<plugins>

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

@@ -54,6 +54,12 @@
 
         /*用于邮寄信息的css*/
         .youxi_xinxi{width: 980px}
+        .txt2{
+            width:80px;
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow: ellipsis;
+        }
     </style>
     <title>添加客诉 - 客诉管理 - RST</title>
 </head>
@@ -162,8 +168,10 @@
                     <input type="text" class="input-text associated-phone" placeholder="用户电话" id="customerTel" name="customerTel" value="">
                 </div>
             </div>
-            <div class="row cl" style="display: none;">
-                <div class="formControls col-9 col-sm-9 text-c" id="onCustomerTable">
+            <input type="hidden" value="" id="customerLastId" name="customerLastId">
+            <input type="hidden" value="" id="customerInitialId" name="customerInitialId">
+            <div class="row cl">
+                <div class="formControls col-9 col-sm-9 text-c" style="display:none;" id="onCustomerTable">
                     <table class="table table-border table-bg table-bordered">
                         <thead>
                         <tr class="text-c">
@@ -184,29 +192,29 @@
                     </table>
                 </div>
             </div>
-            <div class="row cl">
+            <div class="row cl" id="twiceSellEnd">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>二次售后:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
                     <div class="radio-box">
-                        <input type="radio"  name="customerSecondaryCustomer" value="1"  >
-                        <label for="customer-type-1">是</label>
+                        <input type="radio" id="customerSecondaryCustomer1"  name="customerSecondaryCustomer" value="1"  >
+                        <label for="customerSecondaryCustomer1">是</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio"   name="customerSecondaryCustomer" value="2"  checked>
-                        <label for="customer-type-2">否</label>
+                        <input type="radio" id="customerSecondaryCustomer2"  name="customerSecondaryCustomer" value="2" checked>
+                        <label for="customerSecondaryCustomer2">否</label>
                     </div>
                 </div>
             </div>
-            <div class="row cl">
+            <div class="row cl" id="openTheLock">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>开箱损:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
                     <div class="radio-box">
-                        <input type="radio"  name="customerOutDamaged" value="1"  >
-                        <label for="customer-type-1">是</label>
+                        <input type="radio" id="customerOutDamaged1" name="customerOutDamaged" value="1"  >
+                        <label for="customerOutDamaged1">是</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio"   name="customerOutDamaged" value="2"  checked>
-                        <label for="customer-type-2">否</label>
+                        <input type="radio" id="customerOutDamaged2"  name="customerOutDamaged" value="2"  checked>
+                        <label for="customerOutDamaged2">否</label>
                     </div>
                 </div>
             </div>
@@ -460,22 +468,34 @@
             <div class="row cl" id="TDScollect" style="display: none;">
                 <label class="form-label col-1 col-sm-1">TDS收集:</label>
                 <div class="formControls col-2 col-sm-2" style="position: relative;">
-                    <input type="hidden" name="arrcity_3word" id="arrcity_3word" value="" />
+                    <#--<input type="hidden" name="arrcity_3word" id="arrcity_3word" value="" />
                     <input style="width: 190px;" placeholder="" class="input-text my-search-input" placeholder="请输入城市名称搜索" type="text" name="arrcity" id="arrcity" />
-                    <div id="suggest" class="ac_results"></div>
+                    <div id="suggest" class="ac_results"></div>-->
+                    <span class="select-box">
+                        <select name="initProvinceCode" class="select" id="initProvince">
+                            <option value="">请选择省份</option>
+                        </select>
+				    </span>
                 </div>
                 <div class="formControls col-2 col-sm-2">
-				<span class="select-box">
-                    <select name="" class="select" id="TDSArea" name="TDSArea">
-                        <option value="">请搜索城市</option>
-                    </select>
-				</span>
+                    <span class="select-box">
+                        <select name="initCityCode" class="select" id="initCity">
+                            <option value="">请选择城市</option>
+                        </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">
+                            <option value="">请选择区/县</option>
+                        </select>
+				    </span>
+                 </div>
                 <input type="hidden" name="customerArea" id="customerArea">
-                <div class="formControls col-2 col-sm-2">
+                <div class="formControls col-1 col-sm-1">
                     <input type="text" class="input-text" value="" placeholder="进水TDS数值,最大999" id="customerInTDS" name="customerInTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
                 </div>
-                <div class="formControls col-2 col-sm-2">
+                <div class="formControls col-1 col-sm-1">
                     <input type="text" class="input-text" value="" placeholder="出水TDS数值,最大999" id="customerOutTDS" name="customerOutTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
                 </div>
             </div>
@@ -686,7 +706,110 @@
 <script>
 
     $(function(){
+        /*初始化省份*/
+        initProvince();
+        /*监听省份*/
+        $("[name='initProvinceCode']").change(function (){
+            initCity($(this).val());
+        })
+        /*监听城市*/
+        $("[name='initCityCode']").change(function (){
+            initDistrict($(this).val());
+        })
     })
+    /*初始化省份*/
+    function initProvince() {
+        //默认查询参数为空
+        var provinceListInfo = null;
+        $.ajax({
+            type: "POST",
+            data: {
+                provinceId : provinceListInfo
+            },
+            url: "${path}/admin/customerBasic/query_provinceList",
+            async: true,
+            success: function(data){
+                var html = '<option value="">请选择省份</option>';
+                var id;
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.provinceList.length;i++){
+                        provinceListInfo = data.returnMsg.provinceList[i];
+                        if(i == 0 ){
+                            id = provinceListInfo.provinceId;
+                        }
+                        html += '<option value="'+ provinceListInfo.provinceId +'">'+ provinceListInfo.province +'</option>';
+                    }
+                }else{
+                    html = '';
+                }
+                $("[name='initProvinceCode']").html(html);
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+    /*根据省份代号初始化城市*/
+    function initCity(customerProvinceId){
+        var cityListInfo = null;
+        if(customerProvinceId == null || customerProvinceId == ""){
+            var html = '<option value="">请选择城市</option>';
+            $("[name='initCityCode']").html(html);
+        }else{
+            $.ajax({
+                type: "POST",
+                data: {
+                    provinceId : customerProvinceId
+                },
+                url: "${path}/admin/customerBasic/query_cityList",
+                async: true,
+                success: function(data){
+                    var html = '<option value="">请选择城市</option>';
+                    if (data.returnCode == 200) {
+                        for(var i=0;i<data.returnMsg.cityList.length;i++){
+                            cityListInfo = data.returnMsg.cityList[i];
+                            html += '<option value="'+ cityListInfo.cityId +'">'+ cityListInfo.city +'</option>';
+                        }
+                    }else{
+                        html = '';
+                    }
+                    $("[name='initCityCode']").html(html);
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            });
+        }
+    }
+    /*根据省份代号初始化区/县*/
+    function initDistrict(customerCityId){
+        var districtListInfo = null;
+        if(customerCityId == null || customerCityId == ""){
+            var html = '<option value="">请选择区/县</option>';
+            $("[name='initDistrictCode']").html(html);
+        }else{
+            $.ajax({
+                type: "POST",
+                data: {
+                    cityId : customerCityId
+                },
+                url: "${path}/admin/customerBasic/query_districtList",
+                async: true,
+                success: function(data){
+                    var html = '<option value="">请选择区/县</option>';
+                    if (data.returnCode == 200) {
+                        for(var i=0;i<data.returnMsg.districtList.length;i++){
+                            districtListInfo = data.returnMsg.districtList[i];
+                            html += '<option value="'+ districtListInfo.districtId +'">'+ districtListInfo.district +'</option>';
+                        }
+                    }else{
+                        html = '';
+                    }
+                    $("[name='initDistrictCode']").html(html);
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            });
+        }
+    }
 
     /*是否是修改页面*/
     var isUpdate = false;
@@ -750,12 +873,16 @@
             allCustomerInfoType = parseInt($(this).val());
             if(allCustomerInfoType == 1){
                 $("#customer-process-1").iCheck('check');  //设置已解决
+                $("#twiceSellEnd").hide();
+                $("#openTheLock").hide();
                 allCustomerType = 1;
             }else{
                 $("#customer-process-3").iCheck('check');  //设置换新
+                $("#twiceSellEnd").show();
+                $("#openTheLock").show();
                 allCustomerType =3;
             }
-            initProcessResult(allCustomerType);
+            initProcessResult(allCustomerType,allCustomerInfoType);
         })
 
         /*监听处理结果选择事件*/
@@ -825,6 +952,54 @@
         })
 
     })
+    /**
+     *跳转到编辑页面
+     * @param employee
+     */
+    function admin_update_customer(customerId) {
+        window.location.href= "${path}/admin/customer/to_update_customer?customerId="+customerId;
+    }
+    /**
+    * 标记为二次售后
+     customerLastId;//上次客诉id
+     customerInitialId;//初始客诉id
+    * */
+    function markedSecondary(customerLastId,customerInitialId,obj){
+        $("#customerLastId").val(customerLastId);
+        if(customerInitialId == null || customerInitialId == "" || typeof(customerInitialId) == "undefined"){
+            $("#customerInitialId").val(customerLastId);
+        }else{
+            $("#customerInitialId").val(customerInitialId);
+        }
+        $(obj).parents("tr").siblings().css({'background-color':''});
+        $(obj).parents("tr").siblings().each(function(){
+            /*$(this).find("a").eq(1).parent().append('<a onclick="markedSecondary('+customerLastId+','+customerInitialId+',this)">标记为二次售后</a>');*/
+            $(this).find("a").eq(1).show();
+            $(this).find("a").eq(2).hide();
+        })
+
+        $(obj).parents("tr").css('background-color', '#ccc');
+        /*$(obj).parent().append('<a onclick="cancelMarkedSecondary('+customerLastId+','+customerInitialId+',this)">取消二次售后标记</a>');
+        $(obj).remove();*/
+        $(obj).hide();
+        $(obj).next().show();
+        /*$(":radio[name='customerSecondaryCustomer'][value='2']").prop("checked",false);
+        $(":radio[name='customerSecondaryCustomer'][value='1']").prop("checked",true);*/
+
+
+        $("#customerSecondaryCustomer1").iCheck('check');
+    }
+    function cancelMarkedSecondary(customerLastId,customerInitialId,obj){
+        $("#customerLastId").val("");
+        $("#customerInitialId").val("");
+        $(obj).parents("tr").css('background-color', '');
+        /*$(obj).parent().append('<a onclick="markedSecondary('+customerLastId+','+customerInitialId+',this)">标记为二次售后</a>');
+        $(obj).remove();*/
+        $(obj).hide();
+        $(obj).prev().show();
+        $("#customerSecondaryCustomer2").iCheck('check');
+    }
+
 </script>
 
 </body>

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

@@ -137,7 +137,7 @@
             <table class="table table-border table-bordered table-bg table-hover table-sort">
                 <thead>
                 <tr class="text-c">
-                    <th width="10"></th>
+                    <th width="10"><input type="checkbox" class="selectAll" id="selectAll" value="selectAll" ></th>
                     <th width="50">销售公司</th>
                     <th width="50">店铺名称</th>
                     <th width="50">Efast订单号</th>

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

@@ -136,6 +136,23 @@
                     </#list>
                 </div>
             </div>
+            <div class="row cl" id="salesChannelsSelect" style="">
+                <input type="hidden" id="companyId" name="companyId" value="<#if customerInfo??>${customerInfo.companyId!''}</#if>">
+                <input type="hidden" id="storeId" name="storeId" value="<#if customerInfo??>${customerInfo.storeId!''}</#if>">
+                <label class="form-label col-1 col-sm-1">销售渠道:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                         <select id="selectCompany" class="select" name="">
+                         </select>
+                     </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                         <select id="selectStore" class="select" name="">
+                         </select>
+                     </span>
+                </div>
+            </div>
 
             <div class="row cl">
                 <label class="form-label col-1 col-sm-1">客户信息:</label>
@@ -150,7 +167,7 @@
                 </div>
             </div>
 
-            <div class="row cl">
+            <div class="row cl" id="twiceSellEnd">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>二次售后:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
                     <div class="radio-box">
@@ -163,7 +180,7 @@
                     </div>
                 </div>
             </div>
-            <div class="row cl">
+            <div class="row cl" id="openTheLock">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>开箱损:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
                     <div class="radio-box">
@@ -370,23 +387,7 @@
                 </div>
             </div>
 
-            <div class="row cl" id="salesChannelsSelect" style="">
-                <input type="hidden" id="companyId" name="companyId" value="<#if customerInfo??>${customerInfo.companyId!''}</#if>">
-                <input type="hidden" id="storeId" name="storeId" value="<#if customerInfo??>${customerInfo.storeId!''}</#if>">
-                <label class="form-label col-1 col-sm-1">销售渠道:</label>
-                <div class="formControls col-2 col-sm-2">
-                    <span class="select-box">
-                         <select id="selectCompany" class="select" name="">
-                         </select>
-                     </span>
-                </div>
-                <div class="formControls col-2 col-sm-2">
-                    <span class="select-box">
-                         <select id="selectStore" class="select" name="">
-                         </select>
-                     </span>
-                </div>
-            </div>
+            <#--销售渠道-->
 
             <#assign ids = ""/>
             <#if salesOrderList??>
@@ -586,22 +587,41 @@
             <div class="row cl" id="TDScollect" style="display: none;">
                 <label class="form-label col-1 col-sm-1">TDS收集:</label>
                 <div class="formControls col-2 col-sm-2" style="position: relative;">
-                    <input type="hidden" name="arrcity_3word" id="arrcity_3word" value="" />
+                    <#--<input type="hidden" name="arrcity_3word" id="arrcity_3word" value="" />
                     <input style="width: 190px;" placeholder="" class="input-text my-search-input" placeholder="请输入城市名称搜索" type="text" name="arrcity" id="arrcity" value="" />
-                    <div id="suggest" class="ac_results"></div>
+                    <div id="suggest" class="ac_results"></div>-->
+                    <span class="select-box">
+                        <select name="initProvinceCode" class="select" id="initProvince">
+                            <option value="">请选择省份</option>
+                        </select>
+				    </span>
                 </div>
                 <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                        <select name="initCityCode" class="select" id="initCity<#--TDSArea-->" <#--name="TDSArea"-->>
+                            <option value="">请选择城市<#--请搜索城市--></option>
+                        </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">
+                            <option value="">请选择区/县</option>
+                        </select>
+				    </span>
+                </div>
+                <#--<div class="formControls col-2 col-sm-2">
 				<span class="select-box">
                     <select name="" class="select" id="TDSArea" name="TDSArea">
                         <option value="">请搜索城市</option>
                     </select>
 				</span>
-                </div>
+                </div>-->
                 <input type="hidden" name="customerArea" id="customerArea" value="${customerInfo.customerArea!''}">
-                <div class="formControls col-2 col-sm-2">
+                <div class="formControls col-1 col-sm-1">
                     <input type="text" class="input-text" value="${customerInfo.customerInTDS!'0'}" placeholder="进水TDS数值,最大999" id="customerInTDS" name="customerInTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
                 </div>
-                <div class="formControls col-2 col-sm-2">
+                <div class="formControls col-1 col-sm-1">
                     <input type="text" class="input-text" value="${customerInfo.customerOutTDS!'0'}" placeholder="出水TDS数值,最大999" id="customerOutTDS" name="customerOutTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
                 </div>
             </div>
@@ -844,6 +864,112 @@
     /*1:需要有订单    2:不需要有订单*/
     var isNeedSelectOrder = ${customerInfo.isNeedSelectOrder};
 
+    $(function(){
+        /*初始化省份*/
+        initProvince();
+        /*监听省份*/
+        $("[name='initProvinceCode']").change(function (){
+            initCity($(this).val());
+        })
+        /*监听城市*/
+        $("[name='initCityCode']").change(function (){
+            initDistrict($(this).val());
+        })
+    })
+    /*初始化省份*/
+    function initProvince() {
+        //默认查询参数为空
+        var provinceListInfo = null;
+        $.ajax({
+            type: "POST",
+            data: {
+                provinceId : provinceListInfo
+            },
+            url: "${path}/admin/customerBasic/query_provinceList",
+            async: true,
+            success: function(data){
+                var html = '<option value="">请选择省份</option>';
+                var id;
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.provinceList.length;i++){
+                        provinceListInfo = data.returnMsg.provinceList[i];
+                        if(i == 0 ){
+                            id = provinceListInfo.provinceId;
+                        }
+                        html += '<option value="'+ provinceListInfo.provinceId +'">'+ provinceListInfo.province +'</option>';
+                    }
+                }else{
+                    html = '';
+                }
+                $("[name='initProvinceCode']").html(html);
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+    /*根据省份代号初始化城市*/
+    function initCity(customerProvinceId){
+        var cityListInfo = null;
+        if(customerProvinceId == null || customerProvinceId == ""){
+            var html = '<option value="">请选择城市</option>';
+            $("[name='initCityCode']").html(html);
+        }else{
+            $.ajax({
+                type: "POST",
+                data: {
+                    provinceId : customerProvinceId
+                },
+                url: "${path}/admin/customerBasic/query_cityList",
+                async: true,
+                success: function(data){
+                    var html = '<option value="">请选择城市</option>';
+                    if (data.returnCode == 200) {
+                        for(var i=0;i<data.returnMsg.cityList.length;i++){
+                            cityListInfo = data.returnMsg.cityList[i];
+                            html += '<option value="'+ cityListInfo.cityId +'">'+ cityListInfo.city +'</option>';
+                        }
+                    }else{
+                        html = '';
+                    }
+                    $("[name='initCityCode']").html(html);
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            });
+        }
+    }
+    /*根据省份代号初始化区/县*/
+    function initDistrict(customerCityId){
+        var districtListInfo = null;
+        if(customerCityId == null || customerCityId == ""){
+            var html = '<option value="">请选择区/县</option>';
+            $("[name='initDistrictCode']").html(html);
+        }else{
+            $.ajax({
+                type: "POST",
+                data: {
+                    cityId : customerCityId
+                },
+                url: "${path}/admin/customerBasic/query_districtList",
+                async: true,
+                success: function(data){
+                    var html = '<option value="">请选择区/县</option>';
+                    if (data.returnCode == 200) {
+                        for(var i=0;i<data.returnMsg.districtList.length;i++){
+                            districtListInfo = data.returnMsg.districtList[i];
+                            html += '<option value="'+ districtListInfo.districtId +'">'+ districtListInfo.district +'</option>';
+                        }
+                    }else{
+                        html = '';
+                    }
+                    $("[name='initDistrictCode']").html(html);
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            });
+        }
+    }
+
     /*初始化页面参数*/
     $(function () {
         /* 初始化单选框样式 */
@@ -883,12 +1009,16 @@
             allCustomerInfoType = parseInt($(this).val());
             if(allCustomerInfoType == 1){
                 $("#customer-process-1").iCheck('check');  //设置已解决
+                $("#twiceSellEnd").hide();
+                $("#openTheLock").hide();
                 allCustomerType = 1;
             }else{
                 $("#customer-process-3").iCheck('check');  //设置换新
+                $("#twiceSellEnd").show();
+                $("#openTheLock").show();
                 allCustomerType =3;
             }
-            initProcessResult(allCustomerType);
+            initProcessResult(allCustomerType,allCustomerInfoType);
         })
 
         var ty = parseInt($("input[name='typeId']:checked").val());

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

@@ -180,17 +180,24 @@
         </table>
     </div>
 </div>
-<tfoot>
+<#--<tfoot>-->
 <#include "/base/page_util.ftl">
 <script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
 <script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
 <script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
-<script type="text/plain" id="upload_ue"></script>
-</tfoot>
+<#--<script type="text/plain" id="upload_ue"></script>-->
+<#--</tfoot>-->
 <script type="text/javascript">
     /*判断上传类型 1:上传excel推送订单   2:下载订单 */
     var editorType;
     var _editor;
+    /**
+     *跳转到详情页面
+     * @param employee
+     */
+    function sales_order_detail(orderSaleId) {
+        window.location.href= "${path}/admin/salesOrder/select_sales_order?salesId="+orderSaleId;
+    }
     $(function() {
         //重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
         _editor = UE.getEditor('upload_ue',{

+ 9 - 9
watero-rst-web/src/main/webapp/WEB-INF/views/customer/custome_basic_detail.ftl

@@ -118,10 +118,10 @@
 
         <div class="row cl">
             <label class="form-label col-1 col-sm-1"></label>
-            <div class="formControls col-6 col-sm-6 text-c">
+            <div class="formControls col-7 col-sm-7 text-c" style="margin-left: -10px;">
                 <table class="table table-border table-bg table-bordered">
                     <thead>
-                    <tr>
+                    <tr class="text-c">
                         <th>联系人姓名</th>
                         <th>联系电话</th>
                         <th>职位/身份</th>
@@ -132,7 +132,7 @@
 
                     <#if listDockedContactInfo?? &&  (listDockedContactInfo?size > 0) >
                         <#list listDockedContactInfo as list>
-                        <tr>
+                        <tr class="text-c">
                             <td>${list.contactName!''}</td>
                             <td>${list.contactPhone!''}</td>
                             <td>${list.contactType!''}</td>
@@ -158,10 +158,10 @@
 
         <div class="row cl">
             <label class="form-label col-1 col-sm-1"></label>
-            <div class="formControls col-6 col-sm-6 text-c">
+            <div class="formControls col-7 col-sm-7 text-c" style="margin-left: -10px;">
                 <table class="table table-border table-bg table-bordered">
                     <thead>
-                    <tr>
+                    <tr class="text-c">
                         <th>渠道类别</th>
                         <th>渠道类型</th>
                         <th>渠道/平台名称</th>
@@ -172,7 +172,7 @@
 
                         <#if listChannelDivisionInfo?? &&  (listChannelDivisionInfo?size > 0) >
                             <#list listChannelDivisionInfo as list>
-                        <tr>
+                        <tr class="text-c">
                         <td>
                             <#if list.channelCategory == 1 >电商</#if>
                             <#if list.channelCategory == 2 >特殊渠道</#if>
@@ -294,7 +294,7 @@
 
         <div class="row cl">
             <label class="form-label col-1 col-sm-1"></label>
-            <div class="formControls col-6 col-sm-6 text-c">
+            <div class="formControls col-7 col-sm-7 text-c" style="margin-left: -10px;">
                 <table class="table table-border table-bg table-bordered">
                     <thead>
                     <tr class="text-c">
@@ -390,7 +390,7 @@
     <#--new ticketOpening start-->
         <div class="row cl">
             <label class="form-label col-1 col-sm-1"></label>
-            <div class="formControls col-6 col-sm-6 text-c">
+            <div class="formControls col-7 col-sm-7 text-c" style="margin-left: -10px;">
                 <table class="table table-border table-bg table-bordered">
                     <thead>
                     <tr class="text-c">
@@ -438,7 +438,7 @@
         </div>
         <div class="row cl">
             <label class="form-label col-1 col-sm-1"></label>
-            <div class="formControls col-4 col-sm-4">
+            <div class="formControls col-4 col-sm-4" style="margin-left: -10px;">
                 <label>${customerBasicInfo.customerRemarks!''}</label>
             </div>
         </div>

+ 50 - 10
watero-rst-web/src/main/webapp/WEB-INF/views/customer/save_customer_info.ftl

@@ -154,7 +154,7 @@
                     <input type="text" class="input-text"  style="width:140px;margin-right: 10px;"  placeholder="邮箱" id="contactEmail" name="contactEmail">
                 </div>
                 <label class="form-label col-2 col-sm-2" style="width:110px;text-align: right;">
-                    <button type="button" style="cursor:pointer; float: right;height: 31px;margin-bottom: 10px;" class="my-btn-search" id="contactButtonId" onclick="toAddDockedContactInfo();">保存</button></span>
+                    <button type="button" style="cursor:pointer; float: right;height: 31px;margin-bottom: 10px;" class="my-btn-search" id="contactButtonId" onclick="toAddDockedContactInfo();">添加</button></span>
                 </label>
             </div>
             <div class="mt-20" style="margin: 10px 20px 20px 20px;">
@@ -234,10 +234,10 @@
                 <#--<input type="text" class="input-text"  style="width:120px;margin-right: 0px;margin-bottom: 10px;"  placeholder="手动填写供货价格" id="writeSupplyPrice" name="writeSupplyPrice">-->
             </div>
             <div class="formControls col-2 col-sm-2" style="width:80px;padding:0 0;margin-right: 15px;">
-                <input type="text" class="input-text"  style="width:80px;margin-right: 0px;"  placeholder="手动填写供货价格" id="writeSupplyPrice" name="writeSupplyPrice">
+                <input type="text" class="input-text"  style="width:80px;margin-right: 0px;"  placeholder="手动填写供货价格" id="writeSupplyPrice" name="writeSupplyPrice" onkeyup='this.value=this.value.replace(/\D/gi,"")'>
             </div>
             <label class="form-label col-2 col-sm-2" style="width:135px;padding:0 0;">
-                <button type="button" style="cursor:pointer; float: right;height: 31px;" class="my-btn-search" id="channelSaleId" onclick="toAddChannelSaleInfo();">保存</button>
+                <button type="button" style="cursor:pointer; float: right;height: 31px;" class="my-btn-search" id="channelSaleId" onclick="toAddChannelSaleInfo();">添加</button>
             </label>
             <div class="formControls col-2 col-sm-2" style="width:120px; padding:0 0;margin-right: 15px;">
             </div>
@@ -471,6 +471,34 @@
         })
     })
 
+    /*获取产品最低价*/
+
+    function getLowestPrice(){
+        var channelDivisionId = document.getElementById("channelCategory").value;
+        var productId = document.getElementById("promotingProducts").value;
+        var writeSupplyPrice = document.getElementById("writeSupplyPrice").value;
+        var msg = null;
+            $.ajax({
+                type: "POST",
+                data: {
+                    productId : productId,
+                    channelDivisionId : channelDivisionId
+                },
+                url: "${path}/admin/customerBasic/getLowestPrice",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                       if(writeSupplyPrice < data.returnMsg.lowestPriceInfo.lowestPrice){
+                           msg = data.returnMsg.lowestPriceInfo.lowestPrice;
+                       }
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            });
+            return msg;
+    }
+
     /*付款/退款信息填充到开票信息*/
     $("input[name='accountNum']").blur(function (){
         var accountType = $("input[name='accountType']:checked").val();
@@ -660,7 +688,7 @@
                     if (data.returnCode == 200) {
                         for(var i=0;i<data.returnMsg.channelTypeList.length;i++){
                             channelTypeListInfo = data.returnMsg.channelTypeList[i];
-                            html += '<option value="'+ channelTypeListInfo.channelName +'">'+ channelTypeListInfo.channelType +'</option>';
+                            html += '<option value="'+ channelTypeListInfo.channelDivisionId +'">'+ channelTypeListInfo.channelType +'</option>';
                         }
                     }else{
                         html = '';
@@ -725,12 +753,17 @@
                     var html = '';
                     var chose = "手动输入产品价格"
                     if (data.returnCode == 200) {
-                        for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
-                            var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
-                            html += '<option value="'+ supplyPriceInfo.colorPrice/100 +'">'+ supplyPriceInfo.colorPrice/100 +'</option>';
+                        if(data.returnMsg.supplyPriceList.length > 0){
+                            for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
+                                var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
+                                html += '<option value="'+ supplyPriceInfo.colorPrice/100 +'">'+ supplyPriceInfo.colorPrice/100 +'</option>';
+                            }
+                            html += '<option value="00">'+ chose +'</option>';
+                            $("#writeSupplyPrice").hide();
+                        }else{
+                            html += '<option value="00">'+ chose +'</option>';
+                            $("#writeSupplyPrice").show();
                         }
-                        html += '<option value="00">'+ chose +'</option>';
-                        $("#writeSupplyPrice").hide();
                     }else{
                         html = '';
                     }
@@ -869,7 +902,9 @@
         }else if(channelCategory == "4"){
             channelCategory = "海外";
         }
-        var channelType = document.getElementById("channelType").value;
+        /*var channelType = document.getElementById("channelType").value;*/
+        var mychannelType=document.getElementById("channelType");
+        var channelType = mychannelType.options[mychannelType.selectedIndex].text;
         var channelName = document.getElementById("channelName").value;
         var promotingProducts = document.getElementById("promotingProducts").value;
         var myselect=document.getElementById("promotingProducts");
@@ -917,6 +952,11 @@
             layer.msg("供货价格长度超限", {icon:2, time: 3000});
             return;
         }
+        var s = getLowestPrice();
+        if(s != null){
+            layer.msg("最低价格不能少于"+s, {icon:2, time: 3000});
+            return;
+        }
         var promotingProductsHtml = '<input type="hidden" value="'+promotingProducts+'">';
         //var operation = "删除";
         var operation = "<a href='javascript:;' onclick='deleteChannelSale(this)' name='deleteChannelSale'>删除</a>";

+ 45 - 6
watero-rst-web/src/main/webapp/WEB-INF/views/customer/update_customer_info.ftl

@@ -270,7 +270,7 @@
                 </span>
             </div>
             <div class="formControls col-2 col-sm-2" style="width:80px;padding:0 0;">
-                <input type="text" class="input-text"  style="width:80px;margin-right: 0;margin-bottom: 10px;"  placeholder="填写供货价格" id="writeSupplyPrice" name="writeSupplyPrice">
+                <input type="text" class="input-text"  style="width:80px;margin-right: 0;margin-bottom: 10px;"  placeholder="填写供货价格" id="writeSupplyPrice" name="writeSupplyPrice" onkeyup='this.value=this.value.replace(/\D/gi,"")'>
             </div>
 
             <label class="form-label col-2 col-sm-2" style="width:150px;padding:0 0;">
@@ -630,6 +630,35 @@
         }
     });
 
+    /*获取产品最低价*/
+
+    function getLowestPrice(){
+        var channelDivisionId = document.getElementById("channelCategory").value;
+        var productId = document.getElementById("promotingProducts").value;
+        var writeSupplyPrice = document.getElementById("writeSupplyPrice").value;
+        var msg = null;
+        $.ajax({
+            type: "POST",
+            data: {
+                productId : productId,
+                channelDivisionId : channelDivisionId
+            },
+            url: "${path}/admin/customerBasic/getLowestPrice",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    if(writeSupplyPrice < data.returnMsg.lowestPriceInfo.lowestPrice){
+                        msg = data.returnMsg.lowestPriceInfo.lowestPrice;
+                    }
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+        return msg;
+    }
+
+
     /*业务逻辑js控制 start*/
     $(document).on('click', '.dalog-ask .answer', function() {
         var customerProvinceCode = $(this).find(".customerProvinceCode").val();
@@ -860,12 +889,17 @@
                     var html = '';
                     var chose = "手动输入产品价格"
                     if (data.returnCode == 200) {
-                        for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
-                            var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
-                            html += '<option value="'+ supplyPriceInfo.colorPrice/100 +'">'+ supplyPriceInfo.colorPrice/100 +'</option>';
+                        if(data.returnMsg.supplyPriceList.length > 0){
+                            for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
+                                var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
+                                html += '<option value="'+ supplyPriceInfo.colorPrice/100 +'">'+ supplyPriceInfo.colorPrice/100 +'</option>';
+                            }
+                            html += '<option value="00">'+ chose +'</option>';
+                            $("#writeSupplyPrice").hide();
+                        }else{
+                            html += '<option value="00">'+ chose +'</option>';
+                            $("#writeSupplyPrice").show();
                         }
-                        html += '<option value="00">'+ chose +'</option>';
-                        $("#writeSupplyPrice").hide();
                     }else{
                         html = '';
                     }
@@ -1032,6 +1066,11 @@
             layer.msg("供货价格长度超限");
             return;
         }
+        var s = getLowestPrice();
+        if(s != null){
+            layer.msg("最低价格不能少于"+s, {icon:2, time: 3000});
+            return;
+        }
         layer.tips('记得点击底部确认修改按钮哦', '#channelSaleId', {
             tips: [2, '#3595CC'],
             time: 3000

+ 67 - 23
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -410,12 +410,12 @@ function initProduceType(){
  * 选择处理结果-- 默认选择已解决
  * type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货
  */
-function initProcessResult(type){
+function initProcessResult(type,allCustomerInfoType){
 
     if(type == null || type == ""){
         type = 1;
     }
-
+    var customerInfoType = allCustomerInfoType;
     allCustomerType = type;
 
     if(allCustomerInfoType == null || allCustomerInfoType == ""){
@@ -439,12 +439,12 @@ function initProcessResult(type){
         switch(type)
         {
             case 1:
-                otherHied();
+                otherHied(customerInfoType);
                 visitByType(1);
                 //getCompany();
                 break;
             case 2:
-                otherHied();
+                otherHied(customerInfoType);
                 visitByType(2);
                 //getCompany();
                 break;
@@ -498,14 +498,21 @@ function initProcessResult(type){
                 //$("#recipientAddress").show();
                 //$("#recipientAddressText").show();
                 $("#renewedProduct").show();
-                $("#TDScollect").show();
+                //$("#TDScollect").show();
                 $("#TDScollectShow").show();
                 $("#sendAddressInfo").show();
                 $("#sendAddressByPhone").show();
                 $("#updateProduct").hide(); //换新产品
                 $("#postageAccount").show();    //邮费转账账户
                 visitByType(2); //需要回访
-                $("#salesChannelsSelect").show();  //展示销售公司
+                //$("#salesChannelsSelect").show();  //展示销售公司
+                if(customerInfoType == 1){
+                    $("#salesChannelsSelect").hide();  //展示销售公司
+                    $("#TDScollect").hide();
+                }else{
+                    $("#salesChannelsSelect").show();  //展示销售公司
+                    $("#TDScollect").show();
+                }
                 break;
             case 4: //维修
                 result = isSolve.maintain;
@@ -519,14 +526,21 @@ function initProcessResult(type){
                 //$("#recipientAddress").show();
                 //$("#recipientAddressText").show();
                 $("#renewedProduct").show();
-                $("#TDScollect").show();
+                //$("#TDScollect").show();
                 $("#TDScollectShow").show();
                 $("#sendAddressInfo").show();
                 $("#sendAddressByPhone").show();
                 $("#updateProduct").hide();//维修产品
                 $("#postageAccount").show();    //邮费转账账户
                 visitByType(2); //需要回访
-                $("#salesChannelsSelect").show();  //展示销售公司
+                //$("#salesChannelsSelect").show();  //展示销售公司
+                if(customerInfoType == 1){
+                    $("#salesChannelsSelect").hide();  //展示销售公司
+                    $("#TDScollect").hide();
+                }else{
+                    $("#salesChannelsSelect").show();  //展示销售公司
+                    $("#TDScollect").show();
+                }
                 break;
             case 5://补发
                 result = isSolve.reissue;
@@ -540,14 +554,21 @@ function initProcessResult(type){
                 // $("#recipientAddress").show();
                 // $("#recipientAddressText").show();
                 $("#renewedProduct").hide();
-                $("#TDScollect").show();
+                //$("#TDScollect").show();
                 $("#TDScollectShow").show();
                 $("#sendAddressInfo").hide();
                 $("#sendAddressByPhone").hide();
                 $("#updateProduct").hide();
                 $("#postageAccount").hide();    //邮费转账账户 -- 隐藏
                 visitByType(2); //需要回访
-                $("#salesChannelsSelect").show();  //展示销售公司
+                //$("#salesChannelsSelect").show();  //展示销售公司
+                if(customerInfoType == 1){
+                    $("#salesChannelsSelect").hide();  //展示销售公司
+                    $("#TDScollect").hide();
+                }else{
+                    $("#salesChannelsSelect").show();  //展示销售公司
+                    $("#TDScollect").show();
+                }
                 break;
             case 6: //退货
                 result = isSolve.backGoods;
@@ -561,14 +582,21 @@ function initProcessResult(type){
                 //$("#recipientAddress").show();
                 //$("#recipientAddressText").show();
                 $("#renewedProduct").show();
-                $("#TDScollect").show();
+                //$("#TDScollect").show();
                 $("#TDScollectShow").show();
                 $("#sendAddressInfo").show();
                 $("#sendAddressByPhone").show();
                 $("#updateProduct").hide();
                 $("#postageAccount").show();    //邮费转账账户
                 visitByType(2); //需要回访
-                $("#salesChannelsSelect").show();  //展示销售公司
+                //$("#salesChannelsSelect").show();  //展示销售公司
+                if(customerInfoType == 1){
+                    $("#salesChannelsSelect").hide();  //展示销售公司
+                    $("#TDScollect").hide();
+                }else{
+                    $("#salesChannelsSelect").show();  //展示销售公司
+                    $("#TDScollect").show();
+                }
                 break;
             case 7://无理由退货
                 result = isSolve.noReasonBack;
@@ -582,14 +610,21 @@ function initProcessResult(type){
                 //$("#recipientAddress").show();
                 //$("#recipientAddressText").show();
                 $("#renewedProduct").show();
-                $("#TDScollect").show();
+                //$("#TDScollect").show();
                 $("#TDScollectShow").show();
                 $("#sendAddressInfo").show();
                 $("#sendAddressByPhone").show();
                 $("#updateProduct").hide();
                 $("#postageAccount").show();    //邮费转账账户
                 visitByType(2); //需要回访
-                $("#salesChannelsSelect").show();  //展示销售公司
+                //$("#salesChannelsSelect").show();  //展示销售公司
+                if(customerInfoType == 1){
+                    $("#salesChannelsSelect").hide();  //展示销售公司
+                    $("#TDScollect").hide();
+                }else{
+                    $("#salesChannelsSelect").show();  //展示销售公司
+                    $("#TDScollect").show();
+                }
                 break;
             default:
                 break;
@@ -617,8 +652,8 @@ function initProcessResult(type){
 }
 
 /*已解决|未解决 */
-function otherHied(){
-    $("#salesChannelsSelect").show();  //展示销售公司
+function otherHied(customerInfoType){
+    //$("#salesChannelsSelect").show();  //展示销售公司
     $("#processResultStatus").hide();   //处理结果的执行状态  已解决未解决没有该信息
     $("#orderHead").hide();
     $("#order").hide();
@@ -627,11 +662,18 @@ function otherHied(){
     $("#recipientAddress").hide();
     $("#recipientAddressText").hide();
     $("#renewedProduct").hide();
-    $("#TDScollect").show();
+    //$("#TDScollect").show();
     $("#TDScollectShow").show();
     $("#sendAddressInfo").hide();
     $("#sendAddressByPhone").hide();
     $("#updateProduct").hide();
+    if(customerInfoType == 1){
+        $("#salesChannelsSelect").hide();  //展示销售公司
+        $("#TDScollect").hide();
+    }else{
+        $("#salesChannelsSelect").show();  //展示销售公司
+        $("#TDScollect").show();
+    }
 }
 
 /*初始化问题大类*/
@@ -1938,7 +1980,7 @@ function processIsEmpty(process){
 /*===============================客诉提交  -- end -- =============================== */
 
 
-/*$("#customerWechatName").blur(function(){
+$("#customerWechatName").blur(function(){
     selectOnCustomer();
 });
 $("#customerName").blur(function(){
@@ -1946,7 +1988,7 @@ $("#customerName").blur(function(){
 });
 $("#customerTel").blur(function(){
     selectOnCustomer();
-});*/
+});
 /*根据客户信息查询老的客诉---start--*/
 function selectOnCustomer() {
     var customerWechatName = $("#customerWechatName").val();
@@ -1955,6 +1997,7 @@ function selectOnCustomer() {
     if((customerWechatName == null || customerWechatName == "") &&
         (customerName == null || customerName == "") &&
         (customerTel == null || customerTel == "")){
+        $("#onCustomerTable").hide();
         return;
     }
     $.ajax({
@@ -1968,6 +2011,7 @@ function selectOnCustomer() {
             if (data.returnCode == 200) {
                 var onCustomerList = data.returnMsg.onCustomerList;
                 if(onCustomerList != null && onCustomerList.length >0 ){
+                    $("#onCustomerTable").show();
                     var onCustomerTd = "";
                    for(var i = 0;i < onCustomerList.length; i++){
                         var onCustomer = onCustomerList[i];
@@ -1978,7 +2022,6 @@ function selectOnCustomer() {
                        switch (onCustomer.customerIsSolve){
                            case 1:
                                customerIsSolve = "已解决";
-
                                break;
                            case 2:
                                customerIsSolve = "未解决";
@@ -2004,7 +2047,6 @@ function selectOnCustomer() {
                        if(typeof(onCustomer.customerWechatName)=="undefined"){
                            customerWechatName = "";
                        }
-
                        var customerName = onCustomer.customerName;
                        //姓名
                        if(typeof(onCustomer.customerName)=="undefined"){
@@ -2019,8 +2061,10 @@ function selectOnCustomer() {
                            ' <td style="text-align: center;">'+onCustomer.customerTel +'</td>' +
                            ' <td style="text-align: center;">'+customerIsSolve +'</td>' +
                            ' <td style="text-align: center;">'+onCustomer.describeTitle +'</td>' +
-                           ' <td style="text-align: center;">'+onCustomer.describeContent +'</td>' +
-                           ' <td style="text-align: center;"></td>' +
+                           ' <td style="text-align: center;"><span class="txt2" style="display: inline-block;padding: 2px 4px;font-size: 11.844px;" title="'+onCustomer.describeContent +'" >'+onCustomer.describeContent +'</span></td>' +
+                           ' <td style="text-align: center;"><a onclick="admin_update_customer('+onCustomer.customerId +')">继续跟进</a>' +
+                           '<br><a onclick="markedSecondary('+onCustomer.customerId +','+onCustomer.customerInitialId +',this)">标记为二次售后</a>' +
+                           '<a style="display: none;" onclick="cancelMarkedSecondary('+onCustomer.customerId+','+onCustomer.customerInitialId +',this)">取消二次售后标记</a></td>' +
                            ' </tr>' +
                            '';
                    }