瀏覽代碼

添加客户基本信息

dujinyan 7 年之前
父節點
當前提交
052e34f0b1
共有 1 個文件被更改,包括 104 次插入42 次删除
  1. 104 42
      watero-rst-web/src/main/webapp/WEB-INF/views/customer/save_customer_info.ftl

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

@@ -134,10 +134,10 @@
                 <span class="c-red">*</span>电话:<input type="text" class="my-input"  style="width:90px;margin-right: 0px;margin-bottom: 10px;"  placeholder="联系人电话" id="contactPhone" name="contactPhone">
                 <span class="c-red">*</span>职位/身份:<input type="text" class="my-input"  style="width:90px;margin-right: 0px;margin-bottom: 10px;"  placeholder="职位或身份" id="contactType" name="contactType">
                 <span class="c-red">*</span>联系邮箱:<input type="text" class="my-input"  style="width:90px;margin-right: 0px;margin-bottom: 10px;"  placeholder="邮箱" id="contactEmail" name="contactEmail">
-                <span class="c-red"><button type="button" style="cursor:pointer; float: right;height: 35px;margin-right: 30px;margin-bottom: 10px;" class="my-btn-search" onclick="toAddCustomerInfo();">保存</button></span>
+                <span class="c-red"><button type="button" style="cursor:pointer; float: right;height: 35px;margin-right: 30px;margin-bottom: 10px;" class="my-btn-search" onclick="toAddDockedContactInfo();">保存</button></span>
             </div>
             <div class="mt-20" style="margin: 20px;">
-                <table class="table table-border table-bordered table-bg table-hover table-sort">
+                <table class="table table-border table-bordered table-bg table-hover table-sort" id="contactTable">
                     <thead>
                     <tr class="text-c">
                         <th width="100">联系人姓名</th>
@@ -163,12 +163,12 @@
         <div class="row cl">
             <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>渠道类别:</label>
             <div class="formControls col-1 col-sm-1">
-                    <select name="channelCategory" class="select">
+                    <select name="channelCategory" id="channelCategory" class="select">
                     </select>
             </div>
             <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>渠道类型:</label>
             <div class="formControls col-1 col-sm-1">
-                    <select name="channelType" class="select">
+                    <select name="channelType" id="channelType" class="select">
                     </select>
             </div>
             <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>渠道名称:</label>
@@ -177,26 +177,26 @@
             </div>
             <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>销售产品:</label>
             <div class="formControls col-1 col-sm-1">
-                    <select name="promotingProducts" class="select">
+                    <select name="promotingProducts" id="promotingProducts" class="select">
                     </select>
             </div>
             <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>供货价格:</label>
             <div class="formControls col-1 col-sm-1">
-                    <select name="supplyPrice" class="select">
+                    <select name="supplyPrice" id="supplyPrice" class="select">
                     </select>
                     <input type="text" class="my-input"  style="width:90px;margin-right: 0px;margin-bottom: 10px;"  placeholder="填写供货价格" id="supplyPrice" name="supplyPrice">
             </div>
             <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>账期:</label>
             <div class="formControls col-1 col-sm-1">
-                    <select name="accountPeriod" class="select">
+                    <select name="accountPeriod" id="accountPeriod" class="select">
                         <option value="1">先款</option>
                         <option value="2">月结</option>
                         <option value="3">两个月</option>
                     </select>
             </div>
-            <button type="button" style="cursor:pointer; float: right;height: 35px;margin-right: 30px;margin-bottom: 10px;" class="my-btn-search" onclick="toAddCustomerInfo();">保存</button>
+            <button type="button" style="cursor:pointer; float: right;height: 35px;margin-right: 30px;margin-bottom: 10px;" class="my-btn-search" onclick="toAddChannelSaleInfo();">保存</button>
             <div class="mt-20" style="margin: 20px;">
-                <table class="table table-border table-bordered table-bg table-hover table-sort">
+                <table class="table table-border table-bordered table-bg table-hover table-sort" id="saleTable">
                     <thead>
                     <tr class="text-c">
                         <th width="100">渠道类别</th>
@@ -308,8 +308,6 @@
 <#--业务js-->
 <#--<script type="text/javascript" src="${path}/common/js/customerSaveAdmin/save_customer_info.js"></script>-->
 <script>
-    //定义变量
-
     /*初始化页面参数*/
     $(function () {
         /* 初始化单选框样式 */
@@ -447,10 +445,10 @@
     /*根据渠道类别初始化渠道类型*/
     function initChannelType(channelCategory){
         var channelTypeListInfo = null;
-        if(channelCategory == null || channelCategory == ""){
+       /* if(channelCategory == null || channelCategory == ""){
             var html = '<option value="">请选择渠道类别</option>';
             $("[name='channelCategory']").html(html);
-        }else{
+        }else{*/
             $.ajax({
                 type: "POST",
                 data: {
@@ -459,11 +457,11 @@
                 url: "${path}/admin/customerBasic/query_channelTypeList",
                 async: true,
                 success: function(data){
-                    var html = '<option value="">请选择城市</option>';
+                    var html = '<option value="">请选择渠道类型</option>';
                     if (data.returnCode == 200) {
                         for(var i=0;i<data.returnMsg.channelTypeList.length;i++){
                             channelTypeListInfo = data.returnMsg.channelTypeList[i];
-                            html += '<option value="'+ channelTypeListInfo.channelDivisionId +'">'+ channelTypeListInfo.channelType +'</option>';
+                            html += '<option value="'+ channelTypeListInfo.channelName +'">'+ channelTypeListInfo.channelType +'</option>';
                         }
                     }else{
                         html = '';
@@ -473,36 +471,34 @@
                 error: function(XmlHttpRequest, textStatus, errorThrown){
                 }
             });
-        }
+        //}
     }
 
     /*初始化销售产品*/
     function initPromotingProducts() {
-        //默认为售前咨询
-        //var customerCounselTypeOverall = allCustomerInfoType;
-        var customerChannelCategory = null;
+        var promotingProductsInfo = null;
         $.ajax({
             type: "POST",
             data: {
-                complaintConsultingType : customerChannelCategory
+                promotingProductsInfo : promotingProductsInfo
             },
-            url: "${path}/admin/complaintQuestion/list_complaintType",
+            url: "${path}/admin/customerBasic/query_promotingProductsList",
             async: true,
             success: function(data){
-                var html = '<option value="">请选择渠道类别</option>';
+                var html = '<option value="">请选择销售产品</option>';
                 var id;
                 if (data.returnCode == 200) {
-                    for(var i=0;i<data.returnMsg.complaintTypeInfoList.length;i++){
-                        var complaintTypeInfo = data.returnMsg.complaintTypeInfoList[i];
+                    for(var i=0;i<data.returnMsg.promotingProductsList.length;i++){
+                        promotingProductsInfo = data.returnMsg.promotingProductsList[i];
                         if(i == 0 ){
-                            id = complaintTypeInfo.complaintId;
+                            id = promotingProductsInfo.productId;
                         }
-                        html += '<option value="'+ complaintTypeInfo.complaintId +'">'+ complaintTypeInfo.complaintClassName +'</option>';
+                        html += '<option value="'+ promotingProductsInfo.productId +'">'+ promotingProductsInfo.productName +'</option>';
                     }
                 }else{
                     html = '';
                 }
-                $("[name='complaintId']").html(html);
+                $("[name='promotingProducts']").html(html);
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){
             }
@@ -510,39 +506,105 @@
     }
 
     /*初始化产品价格*/
-    function initSupplyPrice(complaintId,smallId){
-        if(complaintId == null || complaintId == ""){
-            var html = '<option value="">请选择渠道类别</option>';
-            $("[name='smallClassId']").html(html);
+    function initSupplyPrice(promotingProductsId){
+        //var supplyPriceInfo = null;
+        if(promotingProductsId == null || promotingProductsId == ""){
+            var html = '<option value="">请选择销售产品</option>';
+            $("[name='promotingProducts']").html(html);
         }else{
             $.ajax({
                 type: "POST",
                 data: {
-                    complaintId : complaintId
+                    promotingProductsId : promotingProductsId
                 },
-                url: "${path}/admin/complaintQuestion/list_complaintSmallClass",
+                url: "${path}/admin/customerBasic/query_supplyPriceList",
                 async: true,
                 success: function(data){
-                    var html = '<option value="">请选择渠道类型</option>';
+                    var html = '<option value="">请选择产品价格</option>';
                     if (data.returnCode == 200) {
-                        for(var i=0;i<data.returnMsg.customerChannelTypeList.length;i++){
-                            var ComplaintSmallClassInfo = data.returnMsg.customerChannelTypeList[i];
-                            html += '<option value="'+ ComplaintSmallClassInfo.smallClassId +'">'+ ComplaintSmallClassInfo.smallClassName +'</option>';
+                        for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
+                            var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
+                            html += '<option value="'+ supplyPriceInfo.colorId +'">'+ supplyPriceInfo.colorPrice +'</option>';
                         }
                     }else{
                         html = '';
                     }
-                    $("[name='smallClassId']").html(html);
-
-                    if(smallId != null && smallId != "" && typeof(smallId)!="undefined" ){
-                        $("select[name='smallClassId']").val(smallId);
-                    }
+                    $("[name='supplyPrice']").html(html);
                 },
                 error: function(XmlHttpRequest, textStatus, errorThrown){
                 }
             });
         }
     }
+
+    /*保存对接联系人信息到列表*/
+    function toAddDockedContactInfo() {
+        var contactName = document.getElementById("contactName").value;
+        var contactPhone = document.getElementById("contactPhone").value;
+        var contactType = document.getElementById("contactType").value;
+        var contactEmail = document.getElementById("contactEmail").value;
+        //var operation = "删除";
+        var operation = "<a href='javascript:;' onclick='deleteContact(this)'>删除</a>";
+        //"<a href='javascript:;' onclick='del(this)'>删除</a>";
+        row = document.getElementById("contactTable").insertRow();
+        if(row!=null){
+            cell=row.insertCell();
+            cell.innerHTML=contactName;
+            cell = row.insertCell();
+            cell.innerHTML=contactPhone;
+            cell = row.insertCell();
+            cell.innerHTML=contactType;
+            cell = row.insertCell();
+            cell.innerHTML=contactEmail;
+            cell = row.insertCell();
+            cell.innerHTML=operation;
+        }
+        return false;
+    }
+    /*保存客户销售信息到列表*/
+    function toAddChannelSaleInfo() {
+        var channelCategory = document.getElementById("channelCategory").value;
+        var channelType = document.getElementById("channelType").value;
+        var channelName = document.getElementById("channelName").value;
+        var promotingProducts = document.getElementById("promotingProducts").value;
+        var supplyPrice = document.getElementById("supplyPrice").value;
+        var accountPeriod = document.getElementById("accountPeriod").value;
+        var operation = "删除";
+        //var operation = var operation = "<a href='javascript:;' onclick='deleteChannelSale(this)'>删除</a>";
+        row = document.getElementById("saleTable").insertRow();
+        if(row!=null){
+            cell=row.insertCell();
+            cell.innerHTML=channelCategory;
+            cell = row.insertCell();
+            cell.innerHTML=channelType;
+            cell = row.insertCell();
+            cell.innerHTML=channelName;
+            cell = row.insertCell();
+            cell.innerHTML=promotingProducts;
+            cell = row.insertCell();
+            cell.innerHTML=supplyPrice;
+            cell = row.insertCell();
+            cell.innerHTML=accountPeriod;
+            cell = row.insertCell();
+            cell.innerHTML=operation;
+        }
+        return false;
+    }
+    /*添加客户信息*/
+    function addCustomerBasicInfo() {
+        alert("addCustomerBasicInfo...");
+    }
+
+    // 删除对接联系人函数
+    function deleteContact(x){
+        $(x).parent().parent().remove();
+        // tr.parentNode.removeChild(tr);
+    }
+    // 删除客户销售渠道信息函数
+    function deleteChannelSale(x){
+        var tr = x.parentNode.parentNode;
+        tr.parentNode.removeChild(tr);
+    }
     /*业务逻辑js控制 end*/
 </script>