Просмотр исходного кода

修复分段价格小写的问题

hulh 8 лет назад
Родитель
Сommit
07fc713356

+ 9 - 9
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_onSaleCtrl.js

@@ -94,7 +94,7 @@ define([ 'app/app' ], function(app) {
                 }else if(qty < price.end) {
                     var end = price.end;
                     price.end = qty - 1;
-                    var obj = {start : qty, end : end, rMBPrice : null, uSDPrice : null};
+                    var obj = {start : qty, end : end, RMBPrice : null, USDPrice : null};
                     commodity.editPrices.splice(i + 1 , 0 , obj);
                     $scope.$$onSale.qty = null;
                     return ;
@@ -456,19 +456,19 @@ define([ 'app/app' ], function(app) {
                 }
                 //目前系统中存在双币别,与现有的逻辑冲突,暂时先用企业地址确定币别
                 if($scope.$$onSale.currency.indexOf('USD') > -1) {
-                    if(!price.uSDPrice) {
+                    if(!price.USDPrice) {
                         toaster.pop('warning', '第' +(i + 1)+'个分段的单价($)为空,请填写后再次提交!');
                         return result;
-                    }else if(isNaN(price.uSDPrice)){
+                    }else if(isNaN(price.USDPrice)){
                         toaster.pop('warning', '第' +(i + 1)+'个分段的单价($)信息必须是数字');
                         return result;
                     }
                 }
                 if($scope.$$onSale.currency.indexOf('RMB') > -1) {
-                    if(!price.rMBPrice) {
+                    if(!price.RMBPrice) {
                         toaster.pop('warning', '第' +(i + 1)+'个分段的单价(¥)为空,请填写后再次提交!');
                         return result;
-                    }else if(isNaN(price.rMBPrice)){
+                    }else if(isNaN(price.RMBPrice)){
                         toaster.pop('warning', '第' +(i + 1)+'个分段的单价(¥)信息必须是数字');
                         return result;
                     }
@@ -490,17 +490,17 @@ define([ 'app/app' ], function(app) {
             }else if(isNaN(num)){
                 toaster.pop('warning', '价格的信息必须只能包含数字');
                 if(isRMB) {
-                    price.rMBPrice = null;
+                    price.RMBPrice = null;
                 }else {
-                    price.uSDPrice = null;
+                    price.USDPrice = null;
                 }
                 return ;
             }else if(Number(num) <= 0) {
                 toaster.pop('warning', '价格的信息必须是大于零的数字');
                 if(isRMB) {
-                    price.rMBPrice = null;
+                    price.RMBPrice = null;
                 }else {
-                    price.uSDPrice = null;
+                    price.USDPrice = null;
                 }
                 return ;
             }

+ 19 - 13
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_standard_putOn_ctrl.js

@@ -177,8 +177,8 @@ define(['app/app'], function (app) {
                 var obj = {
                     start : 1,
                     end : getMaxNumber(toBeSale, standard.editMinBuyQty),
-                    rMBPrice : null,
-                    uSDPrice : null
+                    RMBPrice : null,
+                    USDPrice : null
                 }
                 standard.editQtyPrices.push(obj);
             }else {
@@ -225,7 +225,7 @@ define(['app/app'], function (app) {
                 }else if(qty < price.end) {
                     var end = price.end;
                     price.end = qty -1;
-                    var obj = {start : qty, end : end, rMBPrice : null, uSDPrice : null};
+                    var obj = {start : qty, end : end, RMBPrice : null, USDPrice : null};
                     standard.editQtyPrices.splice(i + 1 , 0 , obj);
                     standard.insertQty = null;
                     return ;
@@ -479,25 +479,25 @@ define(['app/app'], function (app) {
                 }
                 //目前系统中存在双币别,与现有的逻辑冲突,暂时先用企业地址确定币别
                 if($scope.$$putOn.currency.indexOf('USD') > -1) {
-                    if(!fragments[i].uSDPrice) {
+                    if(!fragments[i].USDPrice) {
                         toaster.pop('warning', '第' +(i + 1)+'个分段的单价($)为空,请填写后再次提交!');
                         return result;
-                    }else if(isNaN(fragments[i].uSDPrice)){
+                    }else if(isNaN(fragments[i].USDPrice)){
                         toaster.pop('warning', '第' +(i + 1)+'个分段的单价($)信息必须是数字');
                         return result;
-                    }else if(Number(fragments[i].uSDPrice) < 0) {
+                    }else if(Number(fragments[i].USDPrice) < 0) {
                         toaster.pop('warning', '第' +(i + 1)+'个分段的单价($)信息必须是大于零的数字');
                         return result;
                     }
                 }
                 if($scope.$$putOn.currency.indexOf('RMB') > -1) {
-                    if(!fragments[i].rMBPrice) {
+                    if(!fragments[i].RMBPrice) {
                         toaster.pop('warning', '第' +(i + 1)+'个分段的单价(¥)为空,请填写后再次提交!');
                         return result;
-                    }else if(isNaN(fragments[i].rMBPrice)){
+                    }else if(isNaN(fragments[i].RMBPrice)){
                         toaster.pop('warning', '第' +(i + 1)+'个分段的单价(¥)信息必须是数字');
                         return result;
-                    }else if(Number(fragments[i].rMBPrice) < 0) {
+                    }else if(Number(fragments[i].RMBPrice) < 0) {
                         toaster.pop('warning', '第' +(i + 1)+'个分段的单价(¥)信息必须是大于零的数字');
                         return result;
                     }
@@ -519,17 +519,17 @@ define(['app/app'], function (app) {
             }else if(isNaN(num)){
                 toaster.pop('warning', '价格的信息必须只能包含数字');
                 if(isRMB) {
-                    price.rMBPrice = null;
+                    price.RMBPrice = null;
                 }else {
-                    price.uSDPrice = null;
+                    price.USDPrice = null;
                 }
                 return ;
             }else if(Number(num) <= 0) {
                 toaster.pop('warning', '价格的信息必须是大于零的数字');
                 if(isRMB) {
-                    price.rMBPrice = null;
+                    price.RMBPrice = null;
                 }else {
-                    price.uSDPrice = null;
+                    price.USDPrice = null;
                 }
                 return ;
             }
@@ -625,6 +625,12 @@ define(['app/app'], function (app) {
             }
         };
 
+        $scope.updatePrice = function () {
+            StandardPutOnAdminService.updateQtyPrice({},{},function (data) {
+
+            })
+        };
+
         /**
          * 一键更新
          */

+ 4 - 4
src/main/webapp/resources/view/vendor/forstore/vendor_onSale.html

@@ -782,8 +782,8 @@
                             </td>
                             <td>
                                 <div ng-repeat="price in commodity.prices">
-                                    <span ng-if="$$onSale.currency == 'RMB'" style="margin-left: 20px;" ng-bind="price.rMBPrice | formateNumber : 6 | currencySysmbol : $$onSale.currency">0.52</span>
-                                    <span ng-if="$$onSale.currency == 'USD'" style="margin-left: 20px;" ng-bind="price.uSDPrice | formateNumber : 6 | currencySysmbol : $$onSale.currency">0.52</span>
+                                    <span ng-if="$$onSale.currency == 'RMB'" style="margin-left: 20px;" ng-bind="price.RMBPrice | formateNumber : 6 | currencySysmbol : $$onSale.currency">0.52</span>
+                                    <span ng-if="$$onSale.currency == 'USD'" style="margin-left: 20px;" ng-bind="price.USDPrice | formateNumber : 6 | currencySysmbol : $$onSale.currency">0.52</span>
                                 </div>
                             </td>
                             <td>
@@ -870,8 +870,8 @@
                             <td>
                                 <div ng-repeat="price in commodity.editPrices" class="price">
                                     <span>
-                                        <input ng-if="$$onSale.currency == 'RMB'" type="text" placeholder="单价(含税)¥)" ng-blur="validPrice(price, price.rMBPrice, true)" ng-model="price.rMBPrice" class="width82 form-control"/>
-                                        <input ng-if="$$onSale.currency == 'USD'" type="text" placeholder="单价($)" ng-blur="validPrice(price, price.uSDPrice, false)" ng-model="price.uSDPrice" class="width82 form-control"/>
+                                        <input ng-if="$$onSale.currency == 'RMB'" type="text" placeholder="单价(含税)¥)" ng-blur="validPrice(price, price.RMBPrice, true)" ng-model="price.RMBPrice" class="width82 form-control"/>
+                                        <input ng-if="$$onSale.currency == 'USD'" type="text" placeholder="单价($)" ng-blur="validPrice(price, price.USDPrice, false)" ng-model="price.USDPrice" class="width82 form-control"/>
                                     </span>
                                     <a class="delete" title="删除" ng-click="deleteFragment(commodity, $index)" ng-if="commodity.editPrices.length != 1"><i class="fa fa-trash"></i></a>
                                 </div>

+ 8 - 5
src/main/webapp/resources/view/vendor/forstore/vendor_standard_putOn.html

@@ -352,6 +352,7 @@
                 </form>
             </div>
             <div class="check fr">
+                <button ng-click="updatePrice()">更新分段价格</button>
                 <a  ng-click="batchUpdate()" class="blue">一键更新</a>
             </div>
         </div>
@@ -431,8 +432,8 @@
                         </td>
                         <td>
                             <div ng-repeat="price in standard.qtyPrices">
-                               <span ng-if="standard.currency == 'RMB'" ng-bind="price.rMBPrice | formateNumber : 6 | currencySysmbol : standard.currency"></span>
-                               <span ng-if="standard.currency == 'USD'" ng-bind="price.uSDPrice | formateNumber : 6 | currencySysmbol : standard.currency"></span>
+                               <span ng-if="standard.currency == 'RMB'" ng-bind="price.RMBPrice | formateNumber : 6 | currencySysmbol : standard.currency"></span>
+                               <span ng-if="standard.currency == 'USD'" ng-bind="price.USDPrice | formateNumber : 6 | currencySysmbol : standard.currency"></span>
                                 <span ng-if="!standard.currency">-</span>
                             </div>
                             <div ng-if="!standard.qtyPrices.length">-</div>
@@ -529,14 +530,16 @@
                                 <i class="fa fa-chevron-up"></i>
                             </div>
                             <div style="margin-top: 0;">
-                                <span style="margin-left: 7px;" ng-if="standard.editQtyPrices.length != 3"><input ng-model="standard.insertQty" type="text" placeholder="分段数量" class="form-control" style="width: 104px;"/></span>
+                                <span style="margin-left: 7px;" ng-if="standard.editQtyPrices.length != 3">
+                                    <input ng-model="standard.insertQty" type="text" placeholder="分段数量" class="form-control" style="width: 104px;"/>
+                                </span>
                             </div>
                         </td>
                         <td>
                             <div class="price" ng-repeat="price in standard.editQtyPrices">
                                 <span class="price-input">
-                                    <span ng-if="standard.currency == 'USD'">$</span><input ng-blur="validPrice(price, price.uSDPrice, false)" ng-if="standard.currency == 'USD'" type="text" class="form-control" ng-model="price.uSDPrice" style="width: 65px;" placeholder="单价($)">
-                                    <span ng-if="standard.currency == 'RMB'">¥</span><input ng-blur="validPrice(price, price.rMBPrice, true)" ng-if="standard.currency == 'RMB'" type="text" class="form-control" ng-model="price.rMBPrice" style="width: 65px;" placeholder="单价(¥)">
+                                    <span ng-if="standard.currency == 'USD'">$</span><input ng-blur="validPrice(price, price.USDPrice, false)" ng-if="standard.currency == 'USD'" type="text" class="form-control" ng-model="price.USDPrice" style="width: 65px;" placeholder="单价($)">
+                                    <span ng-if="standard.currency == 'RMB'">¥</span><input ng-blur="validPrice(price, price.RMBPrice, true)" ng-if="standard.currency == 'RMB'" type="text" class="form-control" ng-model="price.RMBPrice" style="width: 65px;" placeholder="单价(¥)">
                                 </span>
                                 <a ng-if="standard.editQtyPrices.length != 1" class="delete" title="删除" ng-click="deleteFragment(standard, $index)"><i class="fa fa-trash"></i></a>
                             </div>