Browse Source

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

hejq 7 years ago
parent
commit
5b7edb1d58

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

@@ -1739,7 +1739,7 @@ public class ProductServiceImpl implements ProductService {
                     return new ResultMap(CodeType.NOT_EXiST, "数据库找不到对应的信息,请重新操作");
                 }
                 Product persistProduct = productDao.findOne(id);
-                if (productPrivate.getB2cEnabled() != IntegerConstant.YES_SHORT) {
+                if (IntegerConstant.NO_SHORT.equals(productPrivate.getB2cEnabled())) {
                     return new ResultMap(CodeType.NOT_PERMIT, "该物料商城未启用,不能操作");
                 }
                 persistProduct.setMinPackQty(product.getMinPackQty());
@@ -1790,7 +1790,7 @@ public class ProductServiceImpl implements ProductService {
                             if (kindResultMap.getCode() != CodeType.OK.code()) {
                                 return kindResultMap;
                             } else {
-                                productPrivate.setKind((String) kindResultMap.getData());
+                                persistProduct.setKind((String) kindResultMap.getData());
                             }
                         }
 

+ 2 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -2026,7 +2026,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		List<ProductPrivate> productPrivates = new ArrayList<>();
 		Set<Long> prIds = new HashSet<>();
 		//需要更新的规格、最小包数量、包装方式
-		Set<ReleaseProductByBatch> updateProducts = new HashSet<>();
 		Map<String, List<PCBPropertyValue>> propertyMap = new HashedMap();
 
         String importNum = createNumberService.getTimeNumber("trade$product_import_num", 8, releaseProductByBatchList.size());
@@ -2090,7 +2089,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		}
 		//保存新生成的物料私有字段
 		if (CollectionUtils.isNotEmpty(productPrivates)) {
-            commonDao.save(productPrivates, ProductPrivate.class);
+			commonDao.save(productPrivates, ProductPrivate.class);
+			productPrivateService.saveProductPrivates(productPrivates);
 		}
 		//将本次临时表中的数据更新到物料表中
 		productService.updateProductsByReleaseProductByBatch(prIds, releaseProductByBatchList, ignoreImport, newInOutboundDetail);

+ 7 - 1
src/main/webapp/resources/js/common/query/material.js

@@ -126,7 +126,13 @@ define([ 'ngResource' ], function() {
             importOneMaterail: {
               url: 'trade/products/edit/one',
               method: 'POST'
-            }
+            },
+          // 根据型号联想词,获取品牌,规格,物料名称等字段
+          getSimilarComponents: {
+            url: 'trade/products/code/keyword',
+            method: 'GET',
+            isArray: true
+          }
         });
     }]);
 });

+ 8 - 0
src/main/webapp/resources/js/vendor/app.js

@@ -988,6 +988,14 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 
 			$rootScope.$on('$stateChangeStart', function (event, toState) {
 
+				if($rootScope.singleEntryInfo) {
+					if (confirm('是否放弃本次编辑?')) {
+            $rootScope.singleEntryInfo = false
+					} else {
+            event.preventDefault()
+					}
+				}
+
 				if (toState.name === 'vendor_store_apply' && $rootScope.applyStatus !== 'NONE') {
 					event.preventDefault();
 					$state.go(getToStateName());

+ 26 - 38
src/main/webapp/resources/js/vendor/controllers/forstore/single_entry.js

@@ -83,6 +83,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
 
     // 品牌change事件
     $scope.onBrandChange = function(brand, index) {
+      $rootScope.singleEntryInfo = true
       $scope.objError.pbranden = false
       if (index === undefined) {
         if (brand === '') {
@@ -118,6 +119,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
     }
 
     $scope.RegulKindBlur  = function() {
+      $rootScope.singleEntryInfo = true
       $scope.objError.kind = false
     }
 
@@ -127,11 +129,12 @@ define(['app/app', 'jquery-uploadify'], function(app) {
      * @param name    品牌名称
      */
     $scope.RegulonBrandBlur = function(name) {
+      $rootScope.singleEntryInfo = true
       // setTimeout(function() {
         if (name === '') {
           $scope.Regul.BrandList = []
         } else {
-          $scope.Regul.pbranden = $scope.Regul.BrandList.value && $scope.Regul.BrandList.value[0].nameEn || name
+          $scope.Regul.pbranden = $scope.Regul.BrandList && $scope.Regul.BrandList.value && $scope.Regul.BrandList.value[0].nameEn || name
           $scope.Regul.BrandList = []
         }
       // }, 300)
@@ -143,6 +146,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
     }
 
     $scope.setBrand = function(brand, index) {
+      $rootScope.singleEntryInfo = true
       if (index === undefined) {
         $scope.Regul.pbranden = brand
         $scope.Regul.BrandList = []
@@ -167,6 +171,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
     ;
 
     $scope.onCodeChange = function(code, index) {
+      $rootScope.singleEntryInfo = true
       $scope.objError.pcmpcode = false
       if (index === undefined) {
         if (code === '') {
@@ -179,27 +184,6 @@ define(['app/app', 'jquery-uploadify'], function(app) {
           return false
         }
         $scope.Regul.CodeList = getSimilarCode(code).$$state
-      } else {
-        if ((/[^\x00-\xff]/g).test(code)) {
-          var chineseIndex = -1;
-          for (var i = 0; i < code.length; i++) {
-            if ((/[^\x00-\xff]/g).test(code.charAt(i))) {
-              chineseIndex = i;
-              break;
-            }
-          }
-          $scope.replaceMaterialList[index].ptrCmpcode = cutOutString(code,
-              chineseIndex);
-        } else if (code && getRealLen(code) > 100) {
-          $scope.replaceMaterialList[index].ptrCmpcode = cutOutString(code,
-              100);
-        } else {
-          if (!code) {
-            $scope.setShowSimilarCodeList(false, index);
-          } else {
-            $scope.getSimilarCode(code, index);
-          }
-        }
       }
     }
     /**
@@ -208,27 +192,25 @@ define(['app/app', 'jquery-uploadify'], function(app) {
      * @param name    型号名称
      */
     $scope.RegulonCodeBlur = function(name) {
+      $rootScope.singleEntryInfo = true
       if (name === '') {
         $scope.Regul.CodeList = []
       } else {
-        $scope.Regul.pcmpcode = $scope.Regul.CodeList.value && $scope.Regul.CodeList.value[0].code || name
+        $scope.Regul.pcmpcode = $scope.Regul.CodeList.value && $scope.Regul.CodeList.value[0].pcmpcode || name
+        $scope.Regul.pbranden = $scope.Regul.CodeList.value && $scope.Regul.CodeList.value[0].pbranden || $scope.Regul.pbranden
+        $scope.Regul.spec = $scope.Regul.CodeList.value && $scope.Regul.CodeList.value[0].pbranden || $scope.Regul.spec
+        $scope.Regul.kind = $scope.Regul.CodeList.value && $scope.Regul.CodeList.value[0].pbranden || $scope.Regul.kind
         $scope.Regul.CodeList = []
       }
     }
     $scope.setCode = function(code, index) {
-        $scope.Regul.pcmpcode = code
-        $scope.Regul.CodeList = []
-    }
+      $rootScope.singleEntryInfo = true
+        $scope.Regul.pcmpcode = code.pcmpcode
 
-    $scope.getSimilarCode = function(keyword, index) {
-      if (keyword) {
-        Search.getSimilarComponents({
-          keyword: keyword
-        }, function(data) {
-          $scope.similarCode = data || [];
-          $scope.setShowSimilarCodeList(data && data.length, index);
-        }, function(error) {})
-      }
+      $scope.Regul.pbranden = code.pbranden
+      $scope.Regul.spec = code.spec
+      $scope.Regul.kind = code.kind
+      $scope.Regul.CodeList = []
     }
 
     var countLength = function(string) {
@@ -241,8 +223,9 @@ define(['app/app', 'jquery-uploadify'], function(app) {
      */
     function getSimilarCode(name) {
       if (name) {
-        return Search.getSimilarComponents({keyword: name}).$promise.then(
+        return Material.getSimilarComponents({keyword: name}).$promise.then(
             function (data) {
+              console.log(data)
               return data.map(function (item) {
                 return item;
               });
@@ -264,6 +247,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
     }
 
     $scope.setPriceMinPackAmount = function(num) {
+      $rootScope.singleEntryInfo = true
       if (num && num.indexOf('.') > -1) {
         toaster.pop('warning', '提示', '最小包装数不能存在小数点')
         $scope.Regul.minPackQty = 1
@@ -274,6 +258,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
     }
 
     $scope.setReserve = function(num) {
+      $rootScope.singleEntryInfo = true
       if (num && num.indexOf('.') > -1) {
         toaster.pop('warning', '提示', '库存数量不能存在小数点')
         $scope.Regul.reserve = 1
@@ -284,11 +269,13 @@ define(['app/app', 'jquery-uploadify'], function(app) {
     }
 
     $scope.setOnePrice = function(num) {
+      $rootScope.singleEntryInfo = true
       $scope.Regul.OnePrice = num
       $scope.objError.OnePrice = false
     }
     // 修改规格书
     $scope.onUploadSuccess = function(data) {
+      $rootScope.singleEntryInfo = true
       $scope.Regul.Regulpic = data.path;
       $scope.Regul.Ischange = true
     };
@@ -333,6 +320,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
         toaster.pop('warning', '提示', '最小包装数未编辑导致无法上架');
         return
       }
+      $rootScope.singleEntryInfo = true
       if (!$scope.Regul.breakUp && $scope.Regul.minBuyQty !== $scope.Regul.minPackQty) {
         if ($scope.Regul.minBuyQty % $scope.Regul.minPackQty !== 0) {
           $scope.Regul.minBuyQty = $scope.Regul.minPackQty
@@ -545,13 +533,13 @@ define(['app/app', 'jquery-uploadify'], function(app) {
         return;
       }
 
-      if ($scope.Regul.minPackQty !== '' && /\D/.test($scope.Regul.minPackQty)) {
+      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)) {
+      if ($scope.Regul.OnePrice && !/^\d+(\.\d+)?$/.test($scope.Regul.OnePrice.trim())) {
         toaster.pop('warning','提示', '成本单价输入不正确')
         $scope.objError.OnePrice = true
         return;

+ 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">

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

@@ -150,8 +150,8 @@
   <div class="pro_management device">
     <div class="com_tab">
       <ul class="fl" style="width: 100%" ng-if="!isPcbStore">
-        <li ng-class="{'active': tab == 'bathOn'}"><a>导入产品</a></li>
-        <li ng-class="{'active': tab == 'single_entry'}"><a ui-sref="single_entry">单个录入</a></li>
+        <li ng-class="{'active': tab == 'bathOn'}"><a ui-sref="vendor_upload">导入产品</a></li>
+        <li ng-class="{'active': tab == 'single_entry'}"><a >单个录入</a></li>
         <!--<li ng-class="{'active': $$productOn.tab == 'bathOn'}" ng-click="toggleActive('bathOn')"><a href="">导入产品并上架</a></li>-->
         <!--<li ng-class="{'active': $$productOn.tab == 'bathOnPerson'}" ng-click="toggleActive('bathOnPerson')"><a href="">导入产品</a></li>-->
       </ul>
@@ -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>
@@ -221,8 +221,8 @@
                    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)" ng-mousedown="stopMounseDown($event)">
-                {{item.code}}
+              <li ng-repeat="item in Regul.CodeList.value" ng-click="setCode(item)" ng-mousedown="stopMounseDown($event)">
+                {{item.pcmpcode}}
               </li>
             </ul>
           </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>