Browse Source

Merge remote-tracking branch 'origin/release-201831-wangcz' into release-201831-wangcz

yujia 7 years ago
parent
commit
3c3cd4ba4e

+ 13 - 12
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -2447,7 +2447,7 @@ public class ProductServiceImpl implements ProductService {
             productInfo = productInfo.setByPrivate(existProducts.get(0));
             // 用户填写库存量是需要做对应的出入库。如果新填写的库存数大于原库存数,做入库。否则做出库。
             inOutbound = recordInventory(product, existProducts.get(0));
-            BeanUtils.copyProperties(product, productInfo, Product.class);
+            BeanUtils.copyProperties(product, productInfo, "id,standard");
         } else {
             // 物料不存在,新增操作
             productInfo = product;
@@ -2703,7 +2703,8 @@ public class ProductServiceImpl implements ProductService {
         }
         final Double minBuyQty = goods.getMinBuyQty();
         // 判断前端传入的分段价格是默认的值还是填写错误
-        int size = goods.getOriginalPrices().size();
+        List<GoodsQtyPrice> qtyPrices = goods.getOriginalPrices();
+        int size = qtyPrices.size();
         if (size == 1) {
             GoodsQtyPrice qtyPrice = goods.getOriginalPrices().get(0);
             // 前端设置的默认值,不用保存
@@ -2713,7 +2714,7 @@ public class ProductServiceImpl implements ProductService {
         } else if (size > 1) {
             StringBuffer errMsg = new StringBuffer();
             for (int i = 0; i < size; i++) {
-                if (null == goods.getOriginalPrices().get(i).getPrice()) {
+                if (null == qtyPrices.get(i).getRMBPrice() && null == qtyPrices.get(i).getUSDPrice()) {
                     jointErrMsg(errMsg, String.valueOf(i + 1));
                 }
             }
@@ -2721,19 +2722,19 @@ public class ProductServiceImpl implements ProductService {
                 throw new IllegalOperatorException("第 " + errMsg.toString() + " 行价格未填写");
             }
         }
-        if (!StringUtils.isEmpty(goods.getQtyPrice())) {
+        if (!StringUtils.isEmpty(qtyPrices)) {
             if (CollectionUtils.isNotEmpty(goods.getOriginalPrices())) {
-                goods.getOriginalPrices().forEach(subPrice -> {
+                qtyPrices.forEach(qtyPrice -> {
                     // 分段数量不能超过最大数量
-                    Double endQty = NumberUtil.compare(subPrice.getEnd(), DoubleConstant.maxReserve) == 1 ? DoubleConstant.maxReserve : subPrice.getEnd();
-                    subPrice.setEnd(endQty);
-
-                    // 起始数量不能大于最小订购数
-                    Double startQty = NumberUtil.compare(minBuyQty, subPrice.getStart()) == 1 ? subPrice.getStart() : minBuyQty;
-                    subPrice.setStart(startQty);
+                    Double endQty = NumberUtil.compare(qtyPrice.getEnd(), DoubleConstant.maxReserve) == 1 ? DoubleConstant.maxReserve : qtyPrice.getEnd();
+                    qtyPrice.setEnd(endQty);
                 });
+
+                // 起始数量不能大于最小订购数
+                Double startQty = NumberUtil.compare(minBuyQty, qtyPrices.get(0).getStart()) == 1 ? qtyPrices.get(0).getStart() : minBuyQty;
+                qtyPrices.get(0).setStart(startQty);
             }
-            goods.setQtyPrice(JSON.toJSONString(goods.getOriginalPrices()));
+            goods.setQtyPrice(JSON.toJSONString(qtyPrices));
         }
         goodsService.setGoodsDefault(goods);
         boolean autoPublish = goods.getAutoPublish() == null ? true : goods.getAutoPublish();

+ 5 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_materialCtrl.js

@@ -4435,7 +4435,11 @@ define(['app/app', 'jquery-uploadify'], function(app) {
           var idStr = $scope.ids.join(',');
           if (chooseTypePeople === 'all') {
             Material.deleteBatch({ids: idStr}, function (data) {
-              toaster.pop('success', '删除成功');
+                if(data.code === 1) {
+                    toaster.pop('success', '删除成功');
+                } else {
+                    toaster.pop('info', '提示', data.message);
+                }
               $scope.deleteModal = false;
               $modalInstance.close(data);
             }, function (response) {

+ 51 - 17
src/main/webapp/resources/js/vendor/controllers/forstore/single_entry.js

@@ -29,7 +29,9 @@ define(['app/app', 'jquery-uploadify'], function(app) {
         pcmpcode: false,
         spec: false,
         minDelivery: false,
-        maxDelivery: false
+        maxDelivery: false,
+        OnePrice: false,
+        minPackQty: false
       }
       for (var i = 0; i < $scope.Regul.prices.length; i++) {
         $scope.Regul.prices[i].priceInvalid = false
@@ -125,12 +127,19 @@ define(['app/app', 'jquery-uploadify'], function(app) {
      * @param name    品牌名称
      */
     $scope.RegulonBrandBlur = function(name) {
-      if (name === '') {
-        $scope.Regul.BrandList = []
-      } else {
-        $scope.Regul.pbranden = $scope.Regul.BrandList.value[0].nameEn
-        $scope.Regul.BrandList = []
-      }
+      // setTimeout(function() {
+        if (name === '') {
+          $scope.Regul.BrandList = []
+        } else {
+          $scope.Regul.pbranden = $scope.Regul.BrandList.value && $scope.Regul.BrandList.value[0].nameEn || name
+          $scope.Regul.BrandList = []
+        }
+      // }, 300)
+    }
+
+    $scope.stopMounseDown = function(e) {
+      var _e = e || window.event
+      _e.preventDefault()
     }
 
     $scope.setBrand = function(brand, index) {
@@ -199,14 +208,12 @@ define(['app/app', 'jquery-uploadify'], function(app) {
      * @param name    型号名称
      */
     $scope.RegulonCodeBlur = function(name) {
-      setTimeout(function() {
-        if (name === '') {
-          $scope.Regul.CodeList = []
-        } else {
-          $scope.Regul.pcmpcode = $scope.Regul.CodeList.value && $scope.Regul.CodeList.value[0].code || name
-          $scope.Regul.CodeList = []
-        }
-      }, 0)
+      if (name === '') {
+        $scope.Regul.CodeList = []
+      } else {
+        $scope.Regul.pcmpcode = $scope.Regul.CodeList.value && $scope.Regul.CodeList.value[0].code || name
+        $scope.Regul.CodeList = []
+      }
     }
     $scope.setCode = function(code, index) {
         $scope.Regul.pcmpcode = code
@@ -257,12 +264,13 @@ define(['app/app', 'jquery-uploadify'], function(app) {
     }
 
     $scope.setPriceMinPackAmount = function(num) {
-      if (num.indexOf('.') > -1) {
+      if (num && num.indexOf('.') > -1) {
         toaster.pop('warning', '提示', '最小包装数不能存在小数点')
         $scope.Regul.minPackQty = 1
       } else {
         $scope.Regul.minPackQty = num
       }
+      $scope.objError.minPackQty = false
     }
 
     $scope.setReserve = function(num) {
@@ -277,6 +285,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
 
     $scope.setOnePrice = function(num) {
       $scope.Regul.OnePrice = num
+      $scope.objError.OnePrice = false
     }
     // 修改规格书
     $scope.onUploadSuccess = function(data) {
@@ -524,12 +533,30 @@ define(['app/app', 'jquery-uploadify'], function(app) {
         return;
       }
 
-      if ($scope.Regul.reserve <=0) {
+      if ($scope.Regul.reserve <= 0) {
         toaster.pop('warning','提示', '库存数量必须大于等于1')
         $scope.objError.reserve = true
         return;
       }
 
+      if (/\D/.test($scope.Regul.reserve)) {
+        toaster.pop('warning','提示', '库存数量只能为正整数')
+        $scope.objError.reserve = true
+        return;
+      }
+
+      if ($scope.Regul.minPackQty !== '' && /\D/.test($scope.Regul.minPackQty)) {
+        toaster.pop('warning','提示', '最小包装数输入不正确')
+        $scope.objError.minPackQty = true
+        return;
+      }
+
+      if ($scope.Regul.OnePrice !== '' && !/^\d+(\.\d+)?$/.test($scope.Regul.OnePrice)) {
+        toaster.pop('warning','提示', '成本单价输入不正确')
+        $scope.objError.OnePrice = true
+        return;
+      }
+
       if (!$scope.Regul.minBuyQty || $scope.Regul.minBuyQty === 0) {
         toaster.pop('warning','提示', '最小起订量必须是大于0的数字')
         $scope.objError.minBuyQty = true
@@ -657,6 +684,13 @@ define(['app/app', 'jquery-uploadify'], function(app) {
       // });
     }
 
+    // document.addEventListener('click', function() {
+    //   $scope.Regul.pcmpcode = $scope.Regul.CodeList&& $scope.Regul.CodeList.value && $scope.Regul.CodeList.value[0].code || name
+    //   $scope.Regul.CodeList = []
+    //   $scope.Regul.pbranden = $scope.Regul.BrandList && $scope.Regul.BrandList.value[0].nameEn
+    //   $scope.Regul.BrandList = []
+    // }, false)
+
 
   }])
 });

+ 5 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js

@@ -4243,7 +4243,11 @@ define(['app/app', 'jquery-uploadify'], function(app) {
           var idStr = $scope.ids.join(',');
           if (chooseTypePeople === 'all') {
             Material.deleteBatch({ids: idStr}, function (data) {
-              toaster.pop('success', '删除成功');
+              if(data.code === 1) {
+                  toaster.pop('success', '删除成功');
+              } else {
+                  toaster.pop('info', '提示', data.message);
+              }
               $scope.deleteModal = false;
               $modalInstance.close(data);
             }, function (response) {

+ 1 - 1
src/main/webapp/resources/view/common/footer.html

@@ -130,7 +130,7 @@ a:hover {
 		<a href="http://www.fantem.com" target="_blank" title="丰唐物联技术(深圳)">丰唐物联技术(深圳)</a>|
 		<a href="http://www.hiways.com" target="_blank" title="深圳市海威思科技">深圳市海威思科技</a>|
 		<a href="http://www.huashangweitai.com" target="_blank" title="深圳市华商维泰显示科技">深圳市华商维泰显示科技</a>|
-		<a href="http://www.ufct.com.cn/" target="_blank" title="联合创泰科技">联合创泰科技</a>
+		<a href="http://www.ufct.com.cn/" target="_blank" title="联合创泰科技">联合创泰科技</a>|
 		<a href="http://www.hi-mantech.com/" target="_blank" title="怡海能达">怡海能达</a>
 	</div>
 	<ul class="list-unstyled footer-bottom">

+ 1 - 1
src/main/webapp/resources/view/sso/rolePermission.html

@@ -907,7 +907,7 @@
     <div class="tab_top" style="margin-bottom: 16px;">
         <ul>
             <li ng-class="{active: tab == 'b2c'}" ng-click="setTab('b2c')"><a href="javascript:void(0)">商城角色</a></li>
-            <li ng-class="{active: tab == 'b2b'}" ng-click="setTab('b2b')"><a href="javascript:void(0)">b2b角色</a></li>
+            <li ng-class="{active: tab == 'b2b'}" ng-click="setTab('b2b')"><a href="javascript:void(0)">B2B角色</a></li>
         </ul>
     </div>
     <!--安全设置-->

+ 2 - 2
src/main/webapp/resources/view/sso/staffManagement.html

@@ -1010,12 +1010,12 @@
                         <td class="edit-btn-area">
                             <!--<a class="operator-trigger" href="javascript:void(0);"><i class="fa fa-pencil fa-lg" ng-show="(userInfo.sys && enterprise.enAdminuu != user.userUU) || users.length == 1"></i></a>-->
                             <div ng-if="user.userUU != userInfo.userUU">  <!--&& enterprise.enAdminuu != user.userUU-->
-                                <span ng-click="addVendor(user)" title="客户分配">b2b客户分配</span>
+                                <span ng-click="addVendor(user)" title="客户分配">B2B客户分配</span>
                                 <span ng-click="editUserRole(user)" title="角色分配"><i></i>角色分配</span>
                                 <span ng-click="setShowDelUserFlag(true, user)" title="删除"><i></i>删除</span>
                             </div>
                             <div ng-if="user.userUU == userInfo.userUU">
-                                <span disabled="false" title="客户分配" style="color: #606168; cursor: not-allowed;"><i></i>b2b客户分配</span>
+                                <span disabled="false" title="客户分配" style="color: #606168; cursor: not-allowed;"><i></i>B2B客户分配</span>
                                 <span disabled="false" title="角色分配" style="color: #606168; cursor: not-allowed;"><i></i>角色分配</span>
                                 <span disabled="false" title="删除" style="color: #606168; cursor: not-allowed;"><i></i>删除</span>
                             </div>

+ 1 - 1
src/main/webapp/resources/view/usercenter/forstore/buyer_material.html

@@ -1062,7 +1062,7 @@
 				<!--<li ng-class="{'active': tab == 'storage'}"><a ui-sref="vendor_storage">出入库</a></li>-->
 				<!--<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架记录</a></li>-->
 				<!--<li ng-if="isPcbStore"><a ui-sref="vendor_upload">产品导入</a></li>-->
-				<!--<li ng-class="{'active': tab == 'B2b'}"><a ui-sref="sale_badOut">B2b客户出入库</a></li>-->
+				<!--<li ng-class="{'active': tab == 'B2b'}"><a ui-sref="sale_badOut">B2B客户出入库</a></li>-->
 			</ul>
 		</div>
 		<div class="com_tab com_tab2" ng-if="!isPcbStore" style="margin-bottom: 0px">

+ 11 - 8
src/main/webapp/resources/view/vendor/forstore/single_entry.html

@@ -165,7 +165,7 @@
         <li ng-class="{'active': tab == 'storage'}"><a ui-sref="vendor_storage">出入库</a></li>
         <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架记录</a></li>
         <li class="active"><a ui-sref="vendor_upload">产品导入</a></li>
-        <li ng-class="{'active': tab == 'B2b'}"><a ui-sref="sale_badOut">B2b客户出入库</a></li>
+        <li ng-class="{'active': tab == 'B2b'}"><a ui-sref="sale_badOut">B2B客户出入库</a></li>
       </ul>
     </div>
   </div>
@@ -178,16 +178,16 @@
           <div class="fl name">
             <span class="red">*</span>品牌:
           </div>
-          <!--ng-blur="RegulonBrandBlur(Regul.pbranden)"-->
+          <!---->
           <div class="fl input" style="position: relative">
             <input type="text"
                    ng-change="onBrandChange(Regul.pbranden)"
                    placeholder="请输入品牌名称"
-
+                   ng-blur="RegulonBrandBlur(Regul.pbranden)"
                    ng-model="Regul.pbranden"
                    class="form-control inputText" maxlength="25" ng-class="objError.pbranden ? 'danger' : '' "/>
             <ul class="listUl" ng-show="Regul.BrandList.value.length > 0">
-              <li ng-repeat="item in Regul.BrandList.value" ng-click="setBrand(item.nameEn)">
+              <li ng-repeat="item in Regul.BrandList.value" ng-click="setBrand(item.nameEn)" ng-mousedown="stopMounseDown($event)">
                 {{item.nameEn}}
               </li>
             </ul>
@@ -216,12 +216,12 @@
             <input type="text"
                    ng-change="onCodeChange(Regul.pcmpcode)"
                    placeholder="请输入型号"
-
+                   ng-blur="RegulonCodeBlur(Regul.pcmpcode)"
                    ng-model="Regul.pcmpcode"
                    ng-class="objError.pcmpcode ? 'danger' : '' "
                    class="form-control inputText" maxlength="100"/>
             <ul class="listUl" ng-show="Regul.CodeList.value.length > 0">
-              <li ng-repeat="item in Regul.CodeList.value" ng-click="setCode(item.code)">
+              <li ng-repeat="item in Regul.CodeList.value" ng-click="setCode(item.code)" ng-mousedown="stopMounseDown($event)">
                 {{item.code}}
               </li>
             </ul>
@@ -262,6 +262,7 @@
                    ng-model="Regul.minPackQty"
                    ng-blur="setPriceMinPackAmount(Regul.minPackQty)"
                    class="form-control inputText" maxlength="50"
+                   ng-class="objError.minPackQty ? 'danger' : '' "
             />
           </div>
         </div>
@@ -275,7 +276,8 @@
                    placeholder="请输入库存数量"
                    ng-model="Regul.reserve"
                    ng-blur="setReserve(Regul.reserve)"
-                   class="form-control inputText" maxlength="50"/>
+                   class="form-control inputText" maxlength="9"
+                   ng-class="objError.reserve ? 'danger' : '' "/>
           </div>
         </div>
         <div class="clearfix w50 fl list">
@@ -288,8 +290,9 @@
                    placeholder="请输入成本单价"
                    ng-model="Regul.OnePrice"
                    ng-blur="setOnePrice(Regul.OnePrice)"
-                   class="form-control inputText" maxlength="50" validata-price
+                   class="form-control inputText" maxlength="12" validata-price
                    oninput="if(value.length>11)value=value.slice(0,11)"
+                   ng-class="objError.OnePrice ? 'danger' : '' "
             />
           </div>
         </div>

+ 1 - 1
src/main/webapp/resources/view/vendor/modal/edit_user_role.html

@@ -179,7 +179,7 @@
 <div class="user-role-manage">
     <div class="user-role-header">
         <span ng-class="{active: tab == 'b2c'}" ng-click="switchTab('b2c')">商城角色</span>
-        <span ng-class="{active: tab == 'b2b'}" ng-click="switchTab('b2b')">b2b角色</span>
+        <span ng-class="{active: tab == 'b2b'}" ng-click="switchTab('b2b')">B2B角色</span>
         <button style=" padding-right:9px; " type="button" class="close" data-dismiss="alert" ng-click="cancelModal()" aria-label="Close">
             <span aria-hidden="true">×</span>
         </button>