Parcourir la source

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

liujiankang il y a 7 ans
Parent
commit
c25a2dc55a

+ 7 - 2
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/CustomerBasicServiceImpl.java

@@ -138,9 +138,14 @@ public class CustomerBasicServiceImpl implements CustomerBasicService{
                 }
                 if(cooperativeState == 2 || cooperativeState ==3){
                     billingInfo.setCustomerId(customerId);
-                    ticketOpeningInfo.setCustomerId(customerId);
                     customerBasicMapper.saveBillingInfo(billingInfo);
-                    customerBasicMapper.saveTicketOpeningInfo(ticketOpeningInfo);
+                    if(ticketOpeningInfo != null){
+                        ticketOpeningInfo.setCustomerId(customerId);
+                        String enterpriseName = ticketOpeningInfo.getEnterpriseName();
+                        if(StringUtil.isNotEmpty(enterpriseName)){
+                            customerBasicMapper.saveTicketOpeningInfo(ticketOpeningInfo);
+                        }
+                    }
                 }
             }
             logger.info("saveCustomerBasicInfo end...");

+ 27 - 6
watero-rst-web/src/main/webapp/WEB-INF/views/cm/report/customer_report.ftl

@@ -60,6 +60,9 @@
 
     var period = "";
 
+    /*表示总数量*/
+    var ALL_NUM = 0;
+
     $(function (){
         showTime();
 
@@ -117,12 +120,15 @@
                 var typeList = data.returnMsg.complaintTypeInfoList;
                 var num = data.returnMsg.num;
 
+                ALL_NUM = data.returnMsg.num;
+
                 var arrayTile = new Array(); // 表格标题数组
                 arrayTile.push("日期");
                 arrayTile.push("类型");
                 arrayTile.push("数量");
                 arrayTile.push("类型");
                 arrayTile.push("数量");
+                arrayTile.push("百分比");
                 arrayTile.push("客诉问题");
                 arrayTile.push("数量");
                 arrayTile.push("百分比");
@@ -179,13 +185,14 @@
                 "width: 10%;",
                 "width: 12%;",
                 "display: none;",
-                "width: 8%;",
+                "width: 6%;",
                 "width: 12%;",
                 "display: none;",
-                "width: 8%;",
+                "width: 6%;",
+                "width: 6%;",
                 "width: 32%;text-align: left !important;",
                 "display: none;",
-                "width: 8%;",
+                "width: 6%;",
                 "width: 10%;background: linear-gradient(to left, #fffcfc, #ff84d4);background-repeat: no-repeat;"
             ];
 
@@ -203,10 +210,10 @@
                             case 4:
                                 str += '<td class="text-c" style="'+ style_array[i] +'"><a href="javascript:void(0);" style="color: #06c;" onclick="showPieChart(' + table_array[index][i+1] + ',\'small\')">' + table_array[index][i] + '<a></td>';
                                 break;
-                            case 7:
+                            case 8:
                                 str += '<td class="text-c" style="'+ style_array[i] +'"><a href="javascript:void(0);" style="color: #06c;" onclick="to_customer_list(' + table_array[index][i+1] + ')">' + table_array[index][i] + '<a></td>';
                                 break;
-                            case 10:
+                            case 11:
                                 str += '<td class="text-c" style="'+ style_array[i] +'background-size: ' + table_array[index][i] + ' 100%;">' + table_array[index][i] + '</td>';
                                 break;
                             default:
@@ -228,6 +235,7 @@
 //            arrayColumn.push(3);
             arrayColumn.push(4);
             arrayColumn.push(5);
+
 //            arrayColumn.push(6);
 
             //合并单元格
@@ -243,12 +251,20 @@
                 if(tdIsStyle){
                     $(this).find("td").eq(3).css("display","none");
                 }
+
                 var td4Rowspan = $(this).find("td").eq(4).attr("rowspan");
                 var td4IsStyle = $(this).find("td").eq(4).css("display")=="none"
                 $(this).find("td").eq(6).attr("rowspan",td4Rowspan);
                 if(td4IsStyle){
                     $(this).find("td").eq(6).css("display","none");
                 }
+
+                var td8Rowspan = $(this).find("td").eq(4).attr("rowspan");
+                var td8IsStyle = $(this).find("td").eq(4).css("display")=="none"
+                $(this).find("td").eq(7).attr("rowspan",td8Rowspan);
+                if(td8IsStyle){
+                    $(this).find("td").eq(7).css("display","none");
+                }
             });
 
         },
@@ -270,7 +286,12 @@
                                     tb_array.push(allTableArray[i].complaintNum)
                                     tb_array.push(small.smallClassName);
                                     tb_array.push(small.smallClassId);
-                                    tb_array.push(small.smallClassNum);
+
+                                    tb_array.push(small.smallClassNum);    //二级分类总数除以总数
+
+                                    var x = (Math.round((small.smallClassNum/allTableArray[i].complaintNum) * 10000)/100).toFixed(2) + '%';
+                                    tb_array.push(x);
+
                                     tb_array.push(question.questionName);
                                     tb_array.push(question.questionId);
                                     tb_array.push(question.questionNum);

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

@@ -137,8 +137,8 @@
             <div class="formControls col-9">
                 <span class="c-red">*</span>姓名:<input type="text" class="input-text"  style="width:100px;margin-right: 10px; margin-bottom: 10px;" placeholder="联系人姓名" id="contactName" name="contactName">
                 <span class="c-red">*</span>电话:<input type="text" class="input-text"  style="width:100px;margin-right: 10px;margin-bottom: 10px;"  placeholder="联系人电话" id="contactPhone" name="contactPhone">
-                <span class="c-red">*</span>职位/身份:<input type="text" class="input-text"  style="width:100px;margin-right: 10px;margin-bottom: 10px;"  placeholder="职位或身份" id="contactType" name="contactType">
-                <span class="c-red">*</span>联系邮箱:<input type="text" class="input-text"  style="width:100px;margin-right: 10px;margin-bottom: 10px;"  placeholder="邮箱" id="contactEmail" name="contactEmail">
+                <span class="c-red">*</span>职位/身份:<input type="text" class="input-text"  style="width:80px;margin-right: 10px;margin-bottom: 10px;"  placeholder="职位或身份" id="contactType" name="contactType">
+                <span class="c-red">*</span>联系邮箱:<input type="text" class="input-text"  style="width:150px;margin-right: 10px;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="toAddDockedContactInfo();">保存</button></span>
             </div>
             <div class="mt-20" style="margin: 20px;">
@@ -205,7 +205,7 @@
                     <select name="supplyPrice" id="supplyPrice" class="select">
                     </select>
                 </span>
-                    <input type="text" class="input-text"  style="width:120px;margin-right: 0px;margin-bottom: 10px;"  placeholder="手动填写供货价格" id="writeSupplyPrice" name="writeSupplyPrice">
+                <input type="text" class="input-text"  style="width:120px;margin-right: 0px;margin-bottom: 10px;"  placeholder="手动填写供货价格" id="writeSupplyPrice" name="writeSupplyPrice">
             </div>
             <label class="form-label col-2 col-sm-2" style="width:120px;"><span class="c-red">*</span>账期:</label>
             <div class="formControls col-2 col-sm-2" style="width:120px; padding:0px 0px;margin-right: 15px;">
@@ -307,7 +307,7 @@
                     </select>
                 </span>
             </div>
-                <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red normalTicketType">*</span>开户支行:</label>
+                <label class="form-label col-2 col-sm-2" style="width: 140px;"><span class="c-red normalTicketType">*</span>开户支行:</label>
                 <div class="formControls col-2 col-sm-2 skin-minimal">
                     <input type="text" class="input-text trim_input" placeholder="开户支行名称" id="ticketAccountOpeningBranch" name="ticketAccountOpeningBranch" value="">
                 </div>
@@ -724,6 +724,25 @@
         $("#contactTbodyId").hide();
         return false;
     }
+
+    //制保留2位小数,如:2,会在2后面补上00.即2.00
+    function toDecimal2(x) {
+        var f = parseFloat(x);
+        if (isNaN(f)) {
+            return false;
+        }
+        var f = Math.round(x*100)/100;
+        var s = f.toString();
+        var rs = s.indexOf('.');
+        if (rs < 0) {
+            rs = s.length;
+            s += '.';
+        }
+        while (s.length <= rs + 2) {
+            s += '0';
+        }
+        return s;
+    }
     /*保存客户销售信息到列表*/
     function toAddChannelSaleInfo() {
         var channelCategory = document.getElementById("channelCategory").value;
@@ -744,8 +763,7 @@
         var supplyPrice = document.getElementById("supplyPrice").value;
         var writeSupplyPrice = document.getElementById("writeSupplyPrice").value;//手动输入价格
         if(writeSupplyPrice != null && writeSupplyPrice !=""){
-            /*writeSupplyPrice = writeSupplyPrice.toFixed(2);
-            alert(writeSupplyPrice);*/
+            writeSupplyPrice = toDecimal2(writeSupplyPrice);
             supplyPrice = writeSupplyPrice;
         }
         var accountPeriod = document.getElementById("accountPeriod").value;
@@ -952,7 +970,8 @@
         }
         //开票信息
         var ticketOpeningInfo = {};
-        if(customerBasicInfo.cooperativeState != "1"){
+        var isOpenTicket = $("input[name='isOpenTicket']:checked").val();
+        if(customerBasicInfo.cooperativeState != "1" && isOpenTicket != "1"){
             ticketOpeningInfo.ticketType = $("[name='ticketType']").val();
             ticketOpeningInfo.accountOpeningBranch = $("[name='ticketAccountOpeningBranch']").val();
             ticketOpeningInfo.ticketOpeningAccount = $("[name='ticketOpeningAccount']").val();