Parcourir la source

客诉页面优化

liujiankang il y a 7 ans
Parent
commit
6f53c1dcc9

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

@@ -365,6 +365,9 @@
     function showUpdateSendProduct() {
         var productList = getProduct() ; //所有产品
         var html = "";
+        if(productList == null){
+            return false;
+        }
         for(var i=0;i<productList.length;i++) {
             var product = productList[i];
             var produceFittings = product.fittingsList;  //获取该产品的所有配件
@@ -485,6 +488,11 @@
     function getProduct(){
         var productList;
         var productName = $("#selectProcuct").val();
+        if(productName == null || productName == ""){
+            var productTable = '<td colspan="3">暂无数据!</td>';
+            $("#addProduct").html(productTable);
+            return null;
+        }
         $.ajax({
             type: "POST",
             data:{'productName':productName},
@@ -492,7 +500,12 @@
             async: false,
             success: function(data){
                 if (data.returnCode == 200) {
+                    $("#addProduct").html("");
                     productList = data.returnMsg.productList;
+                }else{
+                    var productTable = '<td colspan="3">暂无数据!</td>';
+                    $("#addProduct").html(productTable);
+                    return null;
                 }
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){