浏览代码

系统首页优化

liujiankang 6 年之前
父节点
当前提交
48e0e5b6ec

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

@@ -1291,7 +1291,12 @@ public class AdminCustomerController {
             SalesOrder salesOrder = new SalesOrder();
             salesOrder.setSalesCustomerId(Integer.valueOf(customerId));
             List<SalesOrder> salesOrderList = salesOrderService.salesOrderListAndItem(salesOrder);
-            cmRelation.setRelationSendStatus(salesOrderList.get(0).getSalesStatus());
+            if(salesOrderList.size() > 0){
+                cmRelation.setRelationSendStatus(salesOrderList.get(0).getSalesStatus());
+            }else{
+                cmRelation.setRelationSendStatus(0);
+            }
+
             ResponseJson rj = new ResponseJson(200, "查询成功", 200);
             rj.addResponseKeyValue("cmRelation", cmRelation);
 

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

@@ -174,21 +174,28 @@
                 <div class="formControls col-9">
                 </div>
             </div>
-            <div class="row cl" id="salesChannelsSelect">
+            <div class="row cl sales_channel" id="salesChannelsSelect">
                 <input type="hidden" id="companyId" name="companyId" value="" >
                 <input type="hidden" id="storeId" name="storeId" value="" >
                 <label class="form-label col-1 col-sm-1">销售渠道:</label>
                 <div class="formControls col-2 col-sm-2">
                     <span class="select-box">
-                         <select id="selectCompany" class="select" name="">
+                         <select id="selectCompany" class="select  init_company" name="selectCompany">
                          </select>
                      </span>
                 </div>
-                <div class="formControls col-2 col-sm-2">
+                <#--<div class="formControls col-2 col-sm-2">
                     <span class="select-box">
                          <select id="selectStore" class="select" name="">
                          </select>
                      </span>
+                </div>-->
+                <div class="formControls col-2 col-sm-2">
+                    <input id="store_1" name="maktMaktx" class="input-text" list="datalist_1" value="" placeholder="输入店铺关键字或双击" datatype="*1-20" errormsg="请选择销售店铺!" />
+                    <datalist class="select init_store" id="datalist_1">
+
+                    </datalist>
+                    <#--<input type="hidden" id="salesStoreId" name="salesStoreId">-->
                 </div>
             </div>
             <div class="row cl">
@@ -759,6 +766,7 @@
 <#--<script type="text/javascript" src="${path}/common/lib/cm.lib/airCity.js"></script>-->
 <#--<script type="text/javascript" src="${path}/common/lib/cm.lib/dimensions.js"></script>-->
 <script type="text/javascript" src="${path}/common/lib/cm.lib/suggest.js"></script>
+<script type="text/javascript" src="${path}/common/js/common/salesChannel.js"></script>
 
 <#--百度富文本编译器-->
 <script type="text/javascript" charset="utf-8" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
@@ -770,11 +778,25 @@
 <script type="text/javascript" charset="utf-8" src="${path}/common/js/customer/customer.js"></script>
 
 <script>
+    $("#store_1").on("input",function(){
+        var $options=$("#datalist_1").children();
+
+        for(var i=0;i<$options.length;i++){
+            if($options.eq(i).val().trim()==$("#store_1").val().trim()){
+                $("#storeId").val($options.eq(i).attr("data-id"));
+                break;
+            }else{
+                $("#storeId").val("");
+            }
+        }
+    });
+
     /*加载TDS地址信息*/
     var addressUlc = init_address($(".init_address"));
 
     var ulcRelationAddress = init_address($(".relation_address"));
 
+    var sc = $(".sales_channel").initSalesChannel();
     /*是否是修改页面*/
     var isUpdate = false;
 

+ 0 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/custome_list.ftl

@@ -293,8 +293,6 @@
                                                         <#elseif customer.sendStatus == 11>
                                                             已通知配货
                                                         </#if>
-                                                    <#else>
-                                                        未发货
                                                     </#if>
                                                 </font>
                                             </a>

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

@@ -179,21 +179,22 @@
                 </div>
             </div>
 
-            <div class="row cl" id="salesChannelsSelect" style="">
+            <div class="row cl sales_channel" 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 id="selectCompany" class="select  init_company" name="">
                          </select>
                      </span>
                 </div>
                 <div class="formControls col-2 col-sm-2">
-                    <span class="select-box">
-                         <select id="selectStore" class="select" name="">
-                         </select>
-                     </span>
+                    <input id="store_1" name="maktMaktx" class="input-text" list="datalist_1" value="" placeholder="输入店铺关键字或双击" datatype="*1-20" errormsg="请选择销售店铺!" />
+                    <datalist class="select init_store" id="datalist_1">
+
+                    </datalist>
+                <#--<input type="hidden" id="salesStoreId" name="salesStoreId">-->
                 </div>
             </div>
 
@@ -775,6 +776,18 @@
 <script type="text/javascript" charset="utf-8" src="${path}/common/js/customer/customer.js"></script>
 
 <script type="text/javascript">
+    $("#store_1").on("input",function(){
+        var $options=$("#datalist_1").children();
+
+        for(var i=0;i<$options.length;i++){
+            if($options.eq(i).val().trim()==$("#store_1").val().trim()){
+                $("#storeId").val($options.eq(i).attr("data-id"));
+                break;
+            }else{
+                $("#storeId").val("");
+            }
+        }
+    });
 
     /*加载TDS地址信息*/
     var addressUlc = init_address($(".init_address"));

+ 35 - 29
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -1,7 +1,7 @@
 /**
  * 初始化销售渠道
  */
-getCompany();
+/*getCompany();*/
 /**
  *TDS 城市加载
  *问题回复选择
@@ -211,17 +211,17 @@ var phoneReg2 = /(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]
 /*=============================== 页面加载完成启动事件  -- start -- =============================== */
 $(function (){
     /*监听销售公司选择事件*/
-    $("#selectCompany").change(function (){
+    /*$("#selectCompany").change(function (){
         var companyId = $(this).val();
         $("#companyId").val(companyId);
-        setStore(companyId,$("#selectStore"));       //获取店铺
+        setStore(companyId);       //获取店铺
     })
 
-    /*监听店铺选择事件*/
+    /!*监听店铺选择事件*!/
     $("#selectStore").change(function (){
         var storeId = $(this).val();
         $("#storeId").val(storeId);
-    })
+    })*/
 })
 /*===============================页面加载完成启动事件  -- end -- =============================== */
 
@@ -378,7 +378,7 @@ function initProduceType(){
                 var typeCompany = parseInt($("input:radio[name='typeId']:checked").attr("typeCompany"));
                 $("#selectCompany").val(typeCompany);
                 $("#companyId").val(typeCompany);
-                setStore(typeCompany,$("#selectStore"));       //获取店铺
+                setStore(typeCompany,typeId);       //获取店铺
                 var isOrder = 1;
                 var isShowTDS = 2;//是否展示tds 1是 2否
                 switch (typeId){    //1:Soodo电动牙刷   6:WaterO净水机    7:Aiberle净水机    9 :YULIA净水机
@@ -397,11 +397,11 @@ function initProduceType(){
                         isOrder = 1;
                         isShowTDS = 1;
                         break;
-                    case 16:
+                    case 16://诺米克净水机
                         isOrder = 1;
                         isShowTDS = 1;
                         break;
-                    case 17:
+                    case 17://花作净水机
                         isOrder = 1;
                         isShowTDS = 1;
                         break;
@@ -973,7 +973,7 @@ function setSelectOrder(orderId){
             $("#companyId").val(companyId);
             $("#storeId").val(storeId);
             $("#ids").val(orderId);
-            getCompany();
+            /*getCompany();*/
             layer.close(index);
         },
         error: function(XmlHttpRequest, textStatus, errorThrown){
@@ -1270,10 +1270,8 @@ function TDSLinkage(node,maxNumber,minNumber){
     }
 }
 
-/**
- * 获取销售公司
- */
-function getCompany(companyId){
+/*获取销售公司*/
+/*function getCompany(companyId){
     var currentlyCompanyId = $("#companyId").val();
     if(currentlyCompanyId != null && currentlyCompanyId != ""){
         companyId = currentlyCompanyId;
@@ -1302,14 +1300,11 @@ function getCompany(companyId){
         error: function(XmlHttpRequest, textStatus, errorThrown){
         }
     });
-}
+}*/
 
-/**
- * 展示店铺
- */
-function setStore(companyId,node){
 
-    var html = '<option value="">店铺</option>';
+/*获取销售店铺*/
+function setStore(companyId,typeId){
     $.ajax({
         type: "POST",
         data: {
@@ -1317,19 +1312,29 @@ function setStore(companyId,node){
         },
         url: url_path + "/admin/customer/select_storeInfo",
         success: function(data){
-            var id;
+            $("#datalist_1").empty();    //清空下拉框
             if (data.returnCode == 200) {
                 for(var i=0;i<data.returnMsg.storeInfoList.length;i++){
                     var storeInfo = data.returnMsg.storeInfoList[i];
-                    html += '<option value="'+ storeInfo.storeId +'">'+ storeInfo.storeName +'</option>';
-                }
-            }else{
-                html = '';
-            }
-            $(node).html(html);
-            var currentlyStoreId = $("#storeId").val();
-            if(currentlyStoreId != null && currentlyStoreId != ""){
-                $("#selectStore option[value='" + currentlyStoreId + "']").attr("selected","true");
+
+                    if(typeId == 16) {
+                        if (storeInfo.storeId == 73) {
+                            $("#store_1").val(storeInfo.storeName);
+                            $("#storeId").val(storeInfo.storeId);
+                        }
+                    }else if(typeId == 17) {
+                        if (storeInfo.storeId == 75) {
+                            $("#store_1").val(storeInfo.storeName);
+                            $("#storeId").val(storeInfo.storeId);
+                        }
+                    }else{
+                        if(i == 0){
+                            $("#store_1").val(storeInfo.storeName);
+                            $("#storeId").val(storeInfo.storeId);
+                        }
+                    }
+                        $("#datalist_1").append("<option  data-id='"+storeInfo.storeId+"' value='"+ storeInfo.storeName +"'>"+ storeInfo.storeName +"</option>");
+                    }
             }
         },
         error: function(XmlHttpRequest, textStatus, errorThrown){
@@ -1337,6 +1342,7 @@ function setStore(companyId,node){
     });
 }
 
+
 /**
  * 控制展示订单
  *  1:需要有订单    2:不需要有订单