瀏覽代碼

Merge remote-tracking branch 'origin/developer' into developerD

huangzhiguo 1 年之前
父節點
當前提交
841f5ce4f8

+ 18 - 18
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -1053,23 +1053,23 @@
          normalPrice,
          price,
          ladderPriceFlag,
-         <if test="costPrice != null and costPrice != ''">
+         <if test="costPrice != null">
             costprice,
          </if>
-         <if test="organizeCostPrice != null and organizeCostPrice != ''">
+         <if test="organizeCostPrice != null">
             organizeCostPrice,
          </if>
-         <if test="cmCostPrice != null and cmCostPrice != ''">
+         <if test="cmCostPrice != null">
             cmCostPrice,
          </if>
          stock,
-         <if test="shopPercent != null and shopPercent != ''">
+         <if test="shopPercent != null">
             shopPercent,
          </if>
-         <if test="organizePercent != null and organizePercent != ''">
+         <if test="organizePercent != null">
             organizePercent,
          </if>
-         <if test="cmPercent != null and cmPercent != ''">
+         <if test="cmPercent != null">
             cmPercent,
          </if>
          organizeId,
@@ -1079,23 +1079,23 @@
                 #{normalPrice},
                 #{price},
                 #{ladderPriceFlag},
-                <if test="costPrice != null and costPrice != ''">
+                <if test="costPrice != null">
                     #{costPrice},
                 </if>
-                <if test="organizeCostPrice != null and organizeCostPrice != ''">
+                <if test="organizeCostPrice != null">
                     #{organizeCostPrice},
                 </if>
-                <if test="cmCostPrice != null and cmCostPrice != ''">
+                <if test="cmCostPrice != null">
                     #{cmCostPrice},
                 </if>
                 #{stock},
-                <if test="shopPercent != null and shopPercent != ''">
+                <if test="shopPercent != null">
                     #{shopPercent},
                 </if>
-                <if test="organizePercent != null and organizePercent != ''">
+                <if test="organizePercent != null">
                     #{organizePercent},
                 </if>
-                <if test="cmPercent != null and cmPercent != ''">
+                <if test="cmPercent != null">
                     #{cmPercent},
                 </if>
                 #{organizeId},
@@ -1740,22 +1740,22 @@
             normalPrice=#{normalPrice},
             price=#{price},
             organizeId=#{organizeId},
-            <if test="shopPercent != null and shopPercent !=''">
+            <if test="shopPercent != null">
                 shopPercent=#{shopPercent},
             </if>
-            <if test="organizePercent != null and organizePercent !=''">
+            <if test="organizePercent != null">
                 organizePercent=#{organizePercent},
             </if>
-            <if test="cmPercent != null and cmPercent !=''">
+            <if test="cmPercent != null">
                 cmPercent=#{cmPercent},
             </if>
-            <if test="costPrice != null and costPrice !=''">
+            <if test="costPrice != null">
                 costPrice=#{costPrice},
             </if>
-            <if test="organizeCostPrice != null and organizeCostPrice !=''">
+            <if test="organizeCostPrice != null">
                 organizeCostPrice = #{organizeCostPrice},
             </if>
-            <if test="cmCostPrice != null and cmCostPrice !=''">
+            <if test="cmCostPrice != null">
                 cmCostPrice = #{cmCostPrice},
             </if>
             stock=#{stock},

+ 21 - 14
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -1161,6 +1161,7 @@
         $("#inputForm").validate({
             ignore: "",
             submitHandler: function (form) {
+                event.preventDefault()
                 var flag = true;
                 var shopId = $("#shopId").val()*1;
                 var commodityType = $("input[name='commodityType']:checked").val();
@@ -1175,7 +1176,8 @@
                 }
                 var costCheckFlag = $("input[name='costCheckFlag']:checked").val();
                 var skus = $("#skus .sku")
-                skus.each(function() {
+                if (skus.length > 0) {
+                    skus.each(function() {
                     var cost = $(this)
                     if (costCheckFlag * 1 === 1) {
                         var costPrice = cost.find(".costPrice").val()
@@ -1197,12 +1199,12 @@
                         const num = costPrice*1 + organizeCostPrice*1 + cmCostPrice*1
                         if (shopId != 1161 ) {
                             if (num != price) {
-                                alertx("采美国定成本和需为机构价")
+                                alertx("采美固定成本之和需为机构价")
                                 flag = false;
                             }
                         }else {
                             if (num > price) {
-                                alertx("采美国定成本和不能大于机构价")
+                                alertx("采美固定成本之和不能大于机构价")
                                 flag = false;
                             }
                         }
@@ -1225,20 +1227,22 @@
                         const num = shopPercent*1 + organizePercent*1 + cmPercent*1
                         if (shopId != 1161 ) {
                             if (num != 100) {
-                                alertx("采美佣金比例和需为100")
+                                alertx("采美佣金比例和需为100")
                                 flag = false;
                             }
                         }else {
                             if (num > 100) {
-                                alertx("采美佣金比例和不能大于100")
+                                alertx("采美佣金比例和不能大于100")
                                 flag = false;
                             }
                         }
                     }
                 })
+                }
                 var mallCostCheckFlag = $("input[name='mallCostCheckFlag']:checked").val();
-                var mallSkus = $("#mallSkus")
-                mallSkus.each(function() {
+                var mallSkus = $("#mallSkus .sku")
+                if (mallSkus.length > 0) {
+                    mallSkus.each(function() {
                     var mallCost = $(this)
                     if (mallCostCheckFlag * 1 === 1) {
                         var mallCostPrice = mallCost.find(".costPrice").val()
@@ -1260,12 +1264,12 @@
                         const num = mallCostPrice*1 + mallOrganizeCostPrice*1 + mallCmCostPrice*1
                         if (shopId != 1161 ) {
                             if (num != mallprice) {
-                                alertx("丽格国定成本和需为机构价");
+                                alertx("丽格固定成本之和需为机构价");
                                 flag = false;
                             }
                         } else {
                             if (num > mallprice) {
-                                alertx("丽格国定成本和不能大于机构价")
+                                alertx("丽格固定成本之和不能大于机构价")
                                 flag = false;
                             }
                         }
@@ -1285,20 +1289,21 @@
                             alertx("请输入供应商比例");
                             flag = false;
                         }
-                        const num = mallShopPercent*1 + mallOrganizePercent*1 + cmPercent*1
+                        const num = mallShopPercent*1 + mallOrganizePercent*1 + mallCmPercent*1
                         if (shopId != 1161 ) {
                             if (num != 100) {
-                                alertx("丽格佣金比例和需为100");
+                                alertx("丽格佣金比例和需为100");
                                 flag = false;
                             }
                         } else {
                             if (num > 100) {
-                                alertx("丽格佣金比例和不能大于100")
+                                alertx("丽格佣金比例和不能大于100")
                                 flag = false;
                             }
                         }
                     }
                 })
+                }
                 if ($('#minBuyNumber:visible').length > 0) {
                     var minBuyNumber = $('#minBuyNumber').val();
                     if (minBuyNumber <= 0 || minBuyNumber == '') {
@@ -2177,6 +2182,7 @@
     }
     $(".addSku").click(function () {
         var skuTemplate = $('#skuTemplate').html()
+        var costCheckFlag = $("input[name='costCheckFlag']:checked").val();
         $("#skus").append(skuTemplate).show();
         var current = $("#skus").find('.sku').eq(-1);
         if(skuList.length>0 || mallSkuList.length >0){
@@ -2186,7 +2192,7 @@
         }
         var product = {
             skuIndex: ++skuIndex-1,
-            costCheckFlag: '1',
+            costCheckFlag: costCheckFlag,
             ladderPriceFlag: '0'
         }
         setSkuPrototypeValues(current, product, 0);
@@ -2195,6 +2201,7 @@
 
     $(".addMallSku").click(function () {
         var skuTemplate = $('#skuTemplate').html()
+        var mallCostCheckFlag = $("input[name='mallCostCheckFlag']:checked").val();
         $("#mallSkus").append(skuTemplate).show();
         var current = $("#mallSkus").find('.sku').eq(-1);
         if(skuList.length>0 || mallSkuList.length >0){
@@ -2204,7 +2211,7 @@
         }
         var product = {
             skuIndex: ++skuIndex-1,
-            costCheckFlag: '1',
+            costCheckFlag: mallCostCheckFlag,
             ladderPriceFlag: '0'
         }
         setSkuPrototypeValues(current, product, 4);

+ 1 - 5
src/main/webapp/WEB-INF/views/modules/product-new/productList.jsp

@@ -1047,11 +1047,7 @@
 
     // 审核(正常)
     function auditThis(id, name, status, costCheckFlag, costPrice, shopPercent, newvalidFlag, showtime, addtime, newProductType, validFlag) {
-        //比例成
-        if (null == shopPercent || "" == shopPercent) {
-            $.jBox.confirm("商品暂未填写成本比例,请前往编辑页面完善比例后再审核。","提示");
-            return;
-        }
+
         // 商品成本判断
         if (null == costCheckFlag || "" == costCheckFlag) {
             alertx("成本价未填写,请编辑成本价后再审核");