dujinyan 7 роки тому
батько
коміт
322cbef064

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

@@ -198,7 +198,7 @@
                     <select name="supplyPrice" id="supplyPrice" class="select">
                     </select>
                 </span>
-                    <input type="text" class="input-text"  style="width:90px;margin-right: 0px;margin-bottom: 10px;"  placeholder="填写供货价格" id="supplyPrice" name="supplyPrice">
+                    <input type="text" class="input-text"  style="width:90px;margin-right: 0px;margin-bottom: 10px;"  placeholder="填写供货价格" id="writeSupplyPrice" name="writeSupplyPrice">
             </div>
             <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>账期:</label>
             <div class="formControls col-1 col-sm-1">
@@ -343,6 +343,7 @@
 <#--业务js-->
 <#--<script type="text/javascript" src="${path}/common/js/customerSaveAdmin/save_customer_info.js"></script>-->
 <script>
+    $("#writeSupplyPrice").hide();//隐藏手动输入产品价格框
     /*初始化页面参数*/
     $(function () {
         /* 初始化单选框样式 */
@@ -371,6 +372,11 @@
         $("[name='promotingProducts']").change(function (){
             initSupplyPrice($(this).val());
         })
+
+        /*监听产品价格选择*/
+        $("[name='supplyPrice']").change(function (){
+            changeSupplyPrice($(this).val());
+        })
     })
 
     /*业务逻辑js控制 start*/
@@ -545,7 +551,7 @@
         //var supplyPriceInfo = null;
         if(promotingProductsId == null || promotingProductsId == ""){
             var html = '<option value="">请选择销售产品</option>';
-            $("[name='promotingProducts']").html(html);
+            //$("[name='promotingProducts']").html(html);
         }else{
             $.ajax({
                 type: "POST",
@@ -555,16 +561,17 @@
                 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.supplyPriceList.length;i++){
                             var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
-                            html += '<option value="'+ supplyPriceInfo.colorId +'">'+ supplyPriceInfo.colorPrice +'</option>';
+                            html += '<option value="'+ supplyPriceInfo.colorPrice +'">'+ supplyPriceInfo.colorPrice +'</option>';
                         }
                     }else{
                         html = '';
                     }
                     $("[name='supplyPrice']").html(html);
+                    $("#writeSupplyPrice").show();
                 },
                 error: function(XmlHttpRequest, textStatus, errorThrown){
                 }
@@ -572,6 +579,15 @@
         }
     }
 
+    /*监听产品价格选项*/
+    function changeSupplyPrice(supplyPrice){
+        if(supplyPrice == ""){
+            $("#writeSupplyPrice").show();
+        }else{
+            $("#writeSupplyPrice").hide();
+        }
+    }
+
     /*保存对接联系人信息到列表*/
     function toAddDockedContactInfo() {
         //var dockedContactInfoList =  new Array();
@@ -582,11 +598,13 @@
         var contactType = document.getElementById("contactType").value;
         var contactEmail = document.getElementById("contactEmail").value;
         if(contactName == "" || contactName == null ){
-            alert("联系人姓名不能为空");
+            //alert("联系人姓名不能为空");
+            layer.msg("联系人姓名不能为空",{icon:2,time:2000});
             return;
         }
         if(contactPhone == "" || contactPhone == null ){
-            alert("电话不能为空");
+            //alert("电话不能为空");
+            layer.msg("电话不能为空",{icon:2,time:1000});
             return;
         }
         if(contactType == "" || contactType == null ){
@@ -632,7 +650,18 @@
         var channelName = document.getElementById("channelName").value;
         var promotingProducts = document.getElementById("promotingProducts").value;
         var supplyPrice = document.getElementById("supplyPrice").value;
+        var writeSupplyPrice = document.getElementById("writeSupplyPrice").value;//手动输入价格
+        if(writeSupplyPrice != null && writeSupplyPrice !=""){
+            supplyPrice = writeSupplyPrice;
+        }
         var accountPeriod = document.getElementById("accountPeriod").value;
+        if(accountPeriod == "1"){
+            accountPeriod = "先款";
+        }else if(accountPeriod == "2"){
+            accountPeriod = "月结";
+        }else if(accountPeriod == "3"){
+            accountPeriod = "两个月";
+        }
         if(channelCategory == "" || channelCategory == null ){
             alert("渠道类别不能为空");
             return;
@@ -742,6 +771,13 @@
             channelSaleInfo.promotingProducts = $("[name='promotingProducts']").val();
             channelSaleInfo.supplyPrice = $("[name='supplyPrice']").val();
             channelSaleInfo.accountPeriod = $("[name='accountPeriod']").val();
+            if(channelSaleInfo.accountPeriod == "先款"){
+                channelSaleInfo.accountPeriod = "1";
+            }else if(channelSaleInfo.accountPeriod == "月结"){
+                channelSaleInfo.accountPeriod = "2";
+            }else if(channelSaleInfo.accountPeriod == "两个月"){
+                channelSaleInfo.accountPeriod = "3";
+            }
             channelSaleInfoList.push(channelSaleInfo);
         })
         if(channelSaleInfoList.length<2){