Ver Fonte

Merge remote-tracking branch 'origin/feature-wangcz-201814' into feature-wangcz-201814

wangyc há 7 anos atrás
pai
commit
49880f3193
27 ficheiros alterados com 441 adições e 150 exclusões
  1. 3 1
      src/main/java/com/uas/platform/b2c/common/account/controller/AuthenticationController.java
  2. 13 11
      src/main/java/com/uas/platform/b2c/common/account/controller/SecurityController.java
  3. 13 5
      src/main/java/com/uas/platform/b2c/common/account/model/User.java
  4. 1 1
      src/main/java/com/uas/platform/b2c/common/account/service/impl/UserServiceImpl.java
  5. 7 7
      src/main/java/com/uas/platform/b2c/core/filter/SSOInterceptor.java
  6. 2 1
      src/main/java/com/uas/platform/b2c/prod/product/component/modal/Component.java
  7. 2 1
      src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentInfo.java
  8. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls
  9. 79 51
      src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js
  10. 1 1
      src/main/webapp/resources/js/vendor/app.js
  11. 8 2
      src/main/webapp/resources/js/vendor/controllers/forstore/purchase_offer_ctrl.js
  12. 27 21
      src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js
  13. 15 9
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js
  14. 41 0
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_onSaleCtrl.js
  15. 37 25
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_store_maintain_ctrl.js
  16. 1 1
      src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html
  17. 1 1
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_erp.html
  18. 1 1
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_person_erp.html
  19. 1 1
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_onSale_erp.html
  20. 1 1
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_undercarriage_erp.html
  21. 1 1
      src/main/webapp/resources/view/vendor/forstore/seekPurchase.html
  22. 2 2
      src/main/webapp/resources/view/vendor/forstore/vendor_material.html
  23. 1 1
      src/main/webapp/resources/view/vendor/forstore/vendor_material_person.html
  24. 2 2
      src/main/webapp/resources/view/vendor/forstore/vendor_onSale.html
  25. 1 1
      src/main/webapp/resources/view/vendor/forstore/vendor_undercarriage.html
  26. 2 2
      src/main/webapp/resources/view/vendor/forstore/vendor_upload.html
  27. 178 0
      src/main/webapp/resources/view/vendor/modal/edit_regul_modal.html

+ 3 - 1
src/main/java/com/uas/platform/b2c/common/account/controller/AuthenticationController.java

@@ -132,7 +132,9 @@ public class AuthenticationController {
 		String currUrl;
 		try {
 			currUrl = URLDecoder.decode(resUrl, "UTF-8");
-			currUrl = "/" + currUrl;
+			if (!currUrl.substring(0,1).equals("/")) {
+				currUrl = "/" + currUrl;
+			}
 		} catch (UnsupportedEncodingException e) {
 			throw new IllegalArgumentException("URL编码错误!");
 		}

+ 13 - 11
src/main/java/com/uas/platform/b2c/common/account/controller/SecurityController.java

@@ -366,7 +366,7 @@ public class SecurityController {
 			response.setHeader("P3P","CP=\"CURaADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSPCOR\"");
 
 //			User user = getUserByToken(tk);
-			User mallUser = new User();
+			User mallUser = null;
 			if (userAccount.getMobile() != null) {
 				// UID表示所有系统公认的唯一标识,这里统一使用手机号
 				mallUser = userService.findUserByUserTelNoException(userAccount.getMobile());
@@ -375,10 +375,17 @@ public class SecurityController {
 				mallUser = userService.findUserByUserUUNoException(userAccount.getUserUU());
 			} else {
 				logger.error(String.format("invalid user %s, please set uid or dialectUID", userAccount.getVipName()));
+				return "successCallback({success:'0'})";
+			}
+
+			// 没用用户
+			if (mallUser == null) {
+				UserView userView = AccountUtils.findByUserUU(userAccount.getUserUU());
+				mallUser = userAccountService.save(userView);
 			}
 
 			// 企业判断
-			Enterprise enterprise = new Enterprise();
+			Enterprise enterprise = null;
 			if (userAccount.getSpaceUU() != null) {
 				Enterprise oldEnterprise = enterpriseDao.findByUu(userAccount.getSpaceUU());
 				// 判断商城是否存在当前企业,若存在则设置当前企业即可,若不存在则需新建一个企业后进行设置
@@ -411,17 +418,12 @@ public class SecurityController {
 				} else {
 					enterprise = oldEnterprise;
 				}
-			}
-			// 没用用户
-			if (mallUser == null) {
-				UserView userView = AccountUtils.findByUserUU(userAccount.getUserUU());
-				mallUser = userAccountService.save(userView);
-			}
-			if (enterprise != null && !mallUser.getEnterprises().contains(enterprise)) {
-//				if (!mallUser.getUserUU().equals(enterprise.getEnAdminuu())) {
+				// 用户关联企业
+				if (!mallUser.getEnterprises().contains(enterprise)) {
 					mallUser.getEnterprises().add(enterprise);
-//				}
+				}
 			}
+
 			// 最后一次登录时间
 			Date lastLoginTime = userAccount.getLastLoginTime();
 			if (lastLoginTime != null) {

+ 13 - 5
src/main/java/com/uas/platform/b2c/common/account/model/User.java

@@ -501,12 +501,20 @@ public class User implements Serializable {
 	 */
 	public void setCurrentEnterpriseRoles() {
 		if(!CollectionUtils.isEmpty(this.roles) && this.enterprise != null) {
-			Iterator<Role> iterator = this.roles.iterator();
+//			Iterator<Role> iterator = this.roles.iterator();
+//			Long enuu = this.enterprise.getUu();
+//			while (iterator.hasNext()) {
+//				Role role = iterator.next();
+//				if(!role.getEnUU().equals(enuu)) {
+//					iterator.remove();
+//				}
+//			}
+			Set<Role> roles = this.roles;
+			this.roles = new HashSet<>();
 			Long enuu = this.enterprise.getUu();
-			while (iterator.hasNext()) {
-				Role role = iterator.next();
-				if(!role.getEnUU().equals(enuu)) {
-					iterator.remove();
+			for (Role role : roles) {
+				if (role.getEnUU().equals(enuu)) {
+					this.roles.add(role);
 				}
 			}
 		}

+ 1 - 1
src/main/java/com/uas/platform/b2c/common/account/service/impl/UserServiceImpl.java

@@ -558,7 +558,7 @@ public class UserServiceImpl implements UserService {
 		}
 		ModelMap map = new ModelMap();
 		map.put("status","fail");
-		map.put("msg","没有该权限,请联系管理员");
+		map.put("msg","没有该权限,请联系管理员");
 		return map;
 	}
 }

+ 7 - 7
src/main/java/com/uas/platform/b2c/core/filter/SSOInterceptor.java

@@ -238,15 +238,15 @@ public class SSOInterceptor extends AbstractSSOInterceptor {
         }
         // 暂时在正式 过滤admin访问权限
         if (needPermission != null) {
-                if (!user.getEnterprise().getUu().toString().equals(enUU)) {
-                    throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
-                } else {
-                    if (user.getEnterprise().getUu().toString().equals(enUU)) {
-                        if (!"登录商城后台进行运维管理".equals(needPermission)) {
-                            throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
-                        }
+            if (!user.getEnterprise().getUu().toString().equals(enUU)) {
+                throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
+            } else {
+                if (user.getEnterprise().getUu().toString().equals(enUU)) {
+                    if (!"登录商城后台进行运维管理".equals(needPermission)) {
+                        throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
                     }
                 }
+            }
         }
     }
 

+ 2 - 1
src/main/java/com/uas/platform/b2c/prod/product/component/modal/Component.java

@@ -87,7 +87,8 @@ public class Component implements Serializable {
 	/**
 	 * 规格信息
 	 */
-	@Column(name = "cmp_spec")
+//	@Column(name = "cmp_spec")
+	@Transient
 	private String spec;
 
 	/**

+ 2 - 1
src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentInfo.java

@@ -207,7 +207,8 @@ public class ComponentInfo implements Serializable {
 	/**
 	 * 规格信息
 	 */
-	@Column(name = "cmp_spec")
+//	@Column(name = "cmp_spec")
+	@Transient
 	private String spec;
 
 	/**

BIN
src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls


+ 79 - 51
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -6,9 +6,9 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
   'use strict';
   app.register.controller('seekPurchaseCtrl',
       ['$scope', '$location', '$rootScope', 'seekPurchase', 'toaster', 'BaseService',
-        'ngTableParams', 'Order', 'SessionService', '$filter', '$upload', '$stateParams', 'Search', '$http',
+        'ngTableParams', 'Order', 'SessionService', '$filter', '$upload', '$stateParams', 'Search', '$http', 'Authority',
         function ($scope, $location, $rootScope, seekPurchase, toaster, BaseService,
-            ngTableParams, Order, SessionService, $filter, $upload, $stateParams, Search, $http) {
+            ngTableParams, Order, SessionService, $filter, $upload, $stateParams, Search, $http, Authority) {
           $rootScope.active = 'seek_purchase';
           document.title = '我的求购-优软商城';
           $scope.activeType = $stateParams.type ? $stateParams.type :'seekManage';
@@ -443,32 +443,39 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
           };
           // 发布求购
           $scope.release = function () {
-            // 校验
-            if ($scope.checkAll()) {
-                var materialUrl = seekUrl;
-                if (seekUrl == 'https://api-inquiry.usoftmall.com') {
-                    materialUrl = 'https://api-product.usoftmall.com/';
-                }
-                $http({
-                    method: 'get',
-                    dataType: 'json',
-                    url: materialUrl + '/productuser/match/getKind',
-                    params: {cmpCode: $scope.applyObj.code, brand: $scope.applyObj.brand}
-                }).success(function (data) {
-                    startRelease(data && data.length ? data : $scope.applyObj.prodTitle);
-                }).error(function (response) {
-                    startRelease($scope.applyObj.prodTitle);
-                    toaster.pop('error', response || '获取关联类目失败');
-                });
-            } else {
-              if (!$scope.validObj.deadline) {
-                toaster.pop('error', '截止日期不能为空');
-              } else if (!$scope.validObj.unitPrice) {
-                // toaster.pop('error', '单价必须是大于0的数字');
-              } else if (!$scope.validObj.amount) {
-                toaster.pop('error', '请输入正确的数值');
-              }
-            }
+              Authority.getAuthority({resUrl: '/authInquiry/inquiry/buyer/save'}, function (data) {
+                  if (data.status == 'fail') {
+                      toaster.pop('error', data.msg || '系统错误');
+                      return;
+                  } else {
+                      // 校验
+                      if ($scope.checkAll()) {
+                          var materialUrl = seekUrl;
+                          if (seekUrl == 'https://api-inquiry.usoftmall.com') {
+                              materialUrl = 'https://api-product.usoftmall.com/';
+                          }
+                          $http({
+                              method: 'get',
+                              dataType: 'json',
+                              url: materialUrl + '/productuser/match/getKind',
+                              params: {cmpCode: $scope.applyObj.code, brand: $scope.applyObj.brand}
+                          }).success(function (data) {
+                              startRelease(data && data.length ? data : $scope.applyObj.prodTitle);
+                          }).error(function (response) {
+                              startRelease($scope.applyObj.prodTitle);
+                              toaster.pop('error', response || '获取关联类目失败');
+                          });
+                      } else {
+                          if (!$scope.validObj.deadline) {
+                              toaster.pop('error', '截止日期不能为空');
+                          } else if (!$scope.validObj.unitPrice) {
+                              // toaster.pop('error', '单价必须是大于0的数字');
+                          } else if (!$scope.validObj.amount) {
+                              toaster.pop('error', '请输入正确的数值');
+                          }
+                      }
+                  }
+              });
           }
 
           // 立即购买
@@ -584,9 +591,16 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
             });
             // 查看报价
             if (status == 2 && $scope.offerCount != 0) {
-              $scope.offer = seek.qutations;
-              clearSeekStatus();
-              seek.$status = status;
+                Authority.getAuthority({resUrl: '/authInquiry/inquiry/getQuotations'}, function (data) {
+                    if (data.status == 'fail') {
+                        toaster.pop('error', data.msg || '系统错误');
+                        return;
+                    } else {
+                        $scope.offer = seek.qutations;
+                        clearSeekStatus();
+                        seek.$status = status;
+                    }
+                });
             } else if (status == 1 && $scope.goodsCount != 0) {// 查看现货
               clearSeekStatus();
               initFragments();
@@ -914,25 +928,32 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
             // if(($scope.bomFiles == null) || ($scope.bomFiles.length == 0)) {
             //   return ;
             // }
-            var file = angular.element('#uploadCommodity')[0].files[0];
-            console.info(file);
-            if(!file) {
-              toaster.pop('info', '请选择需要上传的文件');
-              return;
-            }
-            $upload.upload({
-              url: 'seek/importBom',
-              file: file,
-              method: 'POST'
-            }).success(function(data) {
-              if (data.success) {
-                window.location.href = "applyPurchase/" + data.data;
-              } else {
-                toaster.pop('error', data.message);
-              }
-            }).error(function(response) {
-              toaster.pop('error', response.data);
-            });
+              Authority.getAuthority({resUrl: '/seek/importBom'}, function (data) {
+                  if (data.status == 'fail') {
+                      toaster.pop('error', data.msg || '系统错误');
+                      return;
+                  } else {
+                      var file = angular.element('#uploadCommodity')[0].files[0];
+                      console.info(file);
+                      if(!file) {
+                          toaster.pop('info', '请选择需要上传的文件');
+                          return;
+                      }
+                      $upload.upload({
+                          url: 'seek/importBom',
+                          file: file,
+                          method: 'POST'
+                      }).success(function(data) {
+                          if (data.success) {
+                              window.location.href = "applyPurchase/" + data.data;
+                          } else {
+                              toaster.pop('error', data.message);
+                          }
+                      }).error(function(response) {
+                          toaster.pop('error', response.data);
+                      });
+                  }
+              });
           };
 
           // 搜索
@@ -993,7 +1014,14 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
           }
 
           $scope.toBomdetail = function(id) {
-            window.location.href = 'user#/bomDetail/' + id
+              Authority.getAuthority({resUrl: '/authInquiry/inquiry/public/findInquiryById'}, function (data) {
+                  if (data.status == 'fail') {
+                      toaster.pop('error', data.msg || '系统错误');
+                      return;
+                  } else {
+                      window.location.href = 'user#/bomDetail/' + id;
+                  }
+              });
           }
           // 分享移入
           $scope.setShowShare = function(seek, index) {

+ 1 - 1
src/main/webapp/resources/js/vendor/app.js

@@ -530,7 +530,7 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
             controllerUrl : "app/controllers/forstore/vendor_materialPersonCtrl",
             controller : 'vendor_materialPersonCtrl'
         })).state('vendor_material_erp', angularAMD.route({
-			title : '企业产品库toErp',
+			title : '公司产品库toErp',
 			url : '/vendor_material_erp?standardParam',
 			templateUrl : 'static/view/vendor/forstore/erp/vendor_material_erp.html',
 			controllerUrl : "app/controllers/forstore/vendor_materialCtrl",

+ 8 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_offer_ctrl.js

@@ -1,5 +1,5 @@
 define(['app/app'], function(app) {
-    app.register.controller('purchaseOfferCtrl', ['$scope', '$rootScope', '$stateParams', '$state', 'toaster', 'seekPurchase', 'BaseService', 'ngTableParams', '$modal', '$http', function ($scope, $rootScope, $stateParams, $state, toaster, seekPurchase, BaseService, ngTableParams, $modal, $http) {
+    app.register.controller('purchaseOfferCtrl', ['$scope', '$rootScope', '$stateParams', '$state', 'toaster', 'seekPurchase', 'BaseService', 'ngTableParams', '$modal', '$http', 'Authority', function ($scope, $rootScope, $stateParams, $state, toaster, seekPurchase, BaseService, ngTableParams, $modal, $http, Authority) {
         document.title = '我的报价-优软商城';
         $rootScope.active = 'vendor_seek_purchase';
         $scope.seekPurchaseRate = {};
@@ -156,7 +156,13 @@ define(['app/app'], function(app) {
         $scope.linkBoxIndex = -1;
 
         $scope.setLinkBoxIndex = function (index) {
-            $scope.linkBoxIndex = index;
+            Authority.getAuthority({resUrl: '/authInquiry/basic/enterprise/tels'}, function (data) {
+                if (data.status == 'fail') {
+                    toaster.pop('error', data.msg || '系统错误');
+                } else {
+                    $scope.linkBoxIndex = index;
+                }
+            });
         }
       });
     }]);

+ 27 - 21
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -1,9 +1,9 @@
 define(['app/app'], function (app) {
   app.register.controller('seekPurchaseCtrl',
       ['$scope', '$location', '$rootScope', '$stateParams', '$state', 'toaster',
-        'seekPurchase', 'BaseService', 'ngTableParams', '$modal', '$upload', '$http',
+        'seekPurchase', 'BaseService', 'ngTableParams', '$modal', '$upload', '$http', 'Authority',
         function ($scope, $location, $rootScope, $stateParams, $state, toaster,
-            seekPurchase, BaseService, ngTableParams, $modal, $upload, $http) {
+            seekPurchase, BaseService, ngTableParams, $modal, $upload, $http, Authority) {
           document.title = '求购询价-优软商城';
           $rootScope.active = 'vendor_seek_purchase';
           $scope.seekPurchaseRate = {};
@@ -309,26 +309,32 @@ define(['app/app'], function (app) {
           $scope.isShowSayPriceBox = false;
           /*设置列表状态*/
           $scope.setSeekActive = function (seek, flag, index) {
-            if (flag) {
-              angular.forEach($scope.seekListData, function (item) {
-                item.$active = false;
-              });
-              $scope.offer = {
-                currency: seek.currency ? seek.currency : "RMB",
-                spId: seek.spId
-              }
-              $scope.inquiryItem = seek;
-              $scope.inquiryItem.leadtime = '';
-              $scope.inquiryItem.replies = [
-                {
-                  lapQty: '',
-                  price: ''
+            Authority.getAuthority({resUrl: '/authInquiry/inquiry/sale/item/save'}, function (data) {
+              if (data.status == 'fail') {
+                toaster.pop('error', data.msg || '系统错误');
+              } else {
+                if (flag) {
+                  angular.forEach($scope.seekListData, function (item) {
+                    item.$active = false;
+                  });
+                  $scope.offer = {
+                    currency: seek.currency ? seek.currency : "RMB",
+                    spId: seek.spId
+                  }
+                  $scope.inquiryItem = seek;
+                  $scope.inquiryItem.leadtime = '';
+                  $scope.inquiryItem.replies = [
+                    {
+                      lapQty: '',
+                      price: ''
+                    }
+                  ];
                 }
-              ];
-            }
-            //seek.$active = flag;
-            $scope.isShowSayPriceBox = flag;
-          }
+                //seek.$active = flag;
+                $scope.isShowSayPriceBox = flag;
+              }
+            });
+          };
 
 
           $scope.onLeadtimeInput = function () {

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

@@ -4,7 +4,7 @@
  */
 define(['app/app'], function (app) {
     "use strict";
-    app.register.controller('vendorAccountManagementCtrl', ['$scope', '$rootScope', 'Enterprise', 'User', 'toaster', '$modal', 'BaseService', 'ngTableParams', '$http', 'AuthenticationService', '$stateParams','AccountResource','AccountRole', function ($scope, $rootScope, Enterprise, User, toaster, $modal, BaseService, ngTableParams, $http, AuthenticationService, $stateParams, AccountResource, AccountRole) {
+    app.register.controller('vendorAccountManagementCtrl', ['$scope', '$rootScope', 'Enterprise', 'User', 'toaster', '$modal', 'BaseService', 'ngTableParams', '$http', 'AuthenticationService', '$stateParams','AccountResource','AccountRole', 'Authority', function ($scope, $rootScope, Enterprise, User, toaster, $modal, BaseService, ngTableParams, $http, AuthenticationService, $stateParams, AccountResource, AccountRole, Authority) {
         $rootScope.active = 'vendor_account_management';
         document.title = '账户管理-优软商城';
         $scope.tab = 'base';
@@ -406,14 +406,20 @@ define(['app/app'], function (app) {
          * 变更到更新状态
          */
         $scope.changeToUpdate = function (isUpdate) {
-            if ($rootScope.userInfo.userUU != $rootScope.userInfo.enterprise.enAdminuu) {
-                toaster.pop('error', '您无该模块的编辑权限,请联系企业管理员进行编辑维护!');
-                return;
-            }
-            $scope.updateState = isUpdate;
-            if ($scope.updateState == false) {
-                $scope.enterpriseInfo = angular.copy($scope.enterpriseInfoBackup);
-            }
+            // if ($rootScope.userInfo.userUU != $rootScope.userInfo.enterprise.enAdminuu) {
+            //     toaster.pop('error', '您无该模块的编辑权限,请联系企业管理员进行编辑维护!');
+            //     return;
+            // }
+            Authority.getAuthority({resUrl: '/basic/enterprise/*/updateInfo'}, function (data) {
+                if (data.status == 'fail') {
+                    toaster.pop('error', data.msg || '系统错误');
+                } else {
+                    $scope.updateState = isUpdate;
+                    if ($scope.updateState == false) {
+                        $scope.enterpriseInfo = angular.copy($scope.enterpriseInfoBackup);
+                    }
+                }
+            });
         };
 
           /**

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

@@ -1550,6 +1550,29 @@ define([ 'app/app' ], function(app) {
         }
 
         /**
+        * 修改规格书
+        */
+        $scope.editRegulPicture = function(Regulpic, commodity) {
+          var modalInstance = $modal.open({
+            templateUrl : 'static/view/vendor/modal/edit_regul_modal.html',
+            size : 'md',
+            controller : 'editRegulationCtrl',
+            resolve : {
+              Regulpic : function() {
+                return Regulpic;
+              }
+            }
+          });
+          modalInstance.result.then(function (Regulpic) {
+            if(Regulpic) {
+              commodity.Regulpic = Regulpic;
+            }
+          }, function() {
+
+          });
+        }
+
+      /**
          * 切换销售模式
          */
         $scope.changeSaleMode = function (commodity) {
@@ -1869,6 +1892,7 @@ define([ 'app/app' ], function(app) {
 
     }]);
 
+    // 上传批次图片
     app.register.controller('editPictureCtrl', ['$scope', 'pic', '$modalInstance', function ($scope, pic, $modalInstance) {
         $scope.pic = pic;
         $scope.cancel = function () {
@@ -1884,4 +1908,21 @@ define([ 'app/app' ], function(app) {
             $modalInstance.close($scope.pic);
         }
     }]);
+
+    // 上传规格书
+    app.register.controller('editRegulationCtrl', ['$scope', 'Regulpic', '$modalInstance', function ($scope, Regulpic, $modalInstance) {
+      $scope.Regulpic = Regulpic;
+      $scope.cancel = function () {
+        $modalInstance.close();
+      };
+
+      // 图片上传成功之后
+      $scope.onUploadSuccess = function(data){
+        $scope.Regulpic = data.path;
+      };
+
+      $scope.confirm = function() {
+        $modalInstance.close($scope.Regulpic);
+      }
+    }]);
 });

+ 37 - 25
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_store_maintain_ctrl.js

@@ -1,6 +1,6 @@
 define(['app/app'], function (app) {
 	"use strict";
-	app.register.controller('vendorStoreMaintainCtrl', ['$scope', '$rootScope', 'Enterprise', 'StoreInfo', '$modal', 'toaster', '$timeout', '$state', 'RecommendProductService', function($scope, $rootScope, Enterprise, StoreInfo, $modal, toaster, $timeout, $state, RecommendProductService) {
+	app.register.controller('vendorStoreMaintainCtrl', ['$scope', '$rootScope', 'Enterprise', 'StoreInfo', '$modal', 'toaster', '$timeout', '$state', 'RecommendProductService', 'Authority', function($scope, $rootScope, Enterprise, StoreInfo, $modal, toaster, $timeout, $state, RecommendProductService, Authority) {
 		$rootScope.active = "vendor_store";
 		document.title = '我的店铺-优软商城';
 		// 编辑状态
@@ -141,11 +141,17 @@ define(['app/app'], function (app) {
 		 * @param module	模块名称
 		 */
 		$scope.showEdit = function (module) {
-			if ($rootScope.userInfo.userUU != $rootScope.userInfo.enterprise.enAdminuu) {
-				toaster.pop('error', '您无该模块的编辑权限,请联系企业管理员进行编辑维护!');
-				return;
-			}
-			changeEditStatus(module, true);
+			// if ($rootScope.userInfo.userUU != $rootScope.userInfo.enterprise.enAdminuu) {
+			// 	toaster.pop('error', '您无该模块的编辑权限,请联系企业管理员进行编辑维护!');
+			// 	return;
+			// }
+			Authority.getAuthority({resUrl: '/store-service/stores/*'}, function (data) {
+				if (data.status == 'fail') {
+					toaster.pop('error', data.msg || '系统错误');
+				} else {
+					changeEditStatus(module, true);
+				}
+			});
 		};
 
 		/**
@@ -545,26 +551,32 @@ define(['app/app'], function (app) {
 		$scope.cancleProductEdit = cancleProductEdit;
 
 		function editRecommendProduct(module, status) {
-			if ($rootScope.userInfo.userUU != $rootScope.userInfo.enterprise.enAdminuu) {
-				toaster.pop('error', '您无该模块的编辑权限,请联系企业管理员进行编辑维护!');
-				return;
-			}
-			if (module == 'BATCH_OPERATION') {
-				$scope.canBatchOperation = status;
-				return ;
-			}
-			if (module == 'EDIT_PRODUCTS') {
-				$scope.canEditProduct = status;
-
-				// 扩充products
-				console.log(10 - $scope.recommendProducts.length);
-				for (var i = $scope.recommendProducts.length; i < 10; i++) {
-					$scope.recommendProducts[i] = { exist: false, order: i + 1 };
+			// if ($rootScope.userInfo.userUU != $rootScope.userInfo.enterprise.enAdminuu) {
+			// 	toaster.pop('error', '您无该模块的编辑权限,请联系企业管理员进行编辑维护!');
+			// 	return;
+			// }
+			Authority.getAuthority({resUrl: '/store-service/stores/*'}, function (data) {
+				if (data.status == 'fail') {
+					toaster.pop('error', data.msg || '系统错误');
+				} else {
+					if (module == 'BATCH_OPERATION') {
+						$scope.canBatchOperation = status;
+						return ;
+					}
+					if (module == 'EDIT_PRODUCTS') {
+						$scope.canEditProduct = status;
+
+						// 扩充products
+						console.log(10 - $scope.recommendProducts.length);
+						for (var i = $scope.recommendProducts.length; i < 10; i++) {
+							$scope.recommendProducts[i] = { exist: false, order: i + 1 };
+						}
+						console.log($scope.recommendProducts.length);
+						return ;
+					}
+					return false;
 				}
-				console.log($scope.recommendProducts.length);
-				return ;
-			}
-			return false;
+			});
 		}
 
 		function cancleProductEdit(module) {

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

@@ -1351,7 +1351,7 @@
                         <div>共 <span class="blue-text" ng-bind="bom.amount || 0"></span> 个产品<!--,<span class="red-text" ng-bind="bom.offerAmount || 0">10</span> 个有报价,<span class="red-text" ng-bind="bom.goodsAmount || 0">7</span> 个有现货--></div>
                         <div ng-bind="bom.releaseDate | date:'yyyy-MM-dd HH:mm:ss'"></div>
                     </div>
-                    <a href="user#/bomDetail/{{bom.id}}" class="fr">查看详情</a>
+                    <a class="fr">查看详情</a>
                 </td>
             </tr>
             <tr ng-if="!$data.length" class="empty">

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_erp.html

@@ -1688,7 +1688,7 @@
 	<div class="pro_management device">
 		<div class="com_tab">
 			<ul class="fl" style="width: 100%">
-				<li class="active"><a ui-sref="vendor_material_erp">企业产品库</a></li>
+				<li class="active"><a ui-sref="vendor_material_erp">公司产品库</a></li>
 				<li><a ui-sref="vendor_material_person_erp">个人产品库</a></li>
 				<li><a ui-sref="vendor_onSale_erp">在售产品</a></li>
 				<li><a ui-sref="vendor_undercarriage_erp">上下架历史</a></li>

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_person_erp.html

@@ -1765,7 +1765,7 @@
 	<div class="pro_management device">
 		<div class="com_tab">
 			<ul class="fl" style="width: 100%">
-				<li><a ui-sref="vendor_material_erp">企业产品库</a></li>
+				<li><a ui-sref="vendor_material_erp">公司产品库</a></li>
 				<li class="active"><a ui-sref="vendor_material_person_erp">个人产品库</a></li>
 				<li><a ui-sref="vendor_onSale_erp">在售产品</a></li>
 				<li><a ui-sref="vendor_undercarriage_erp">上下架历史</a></li>

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/erp/vendor_onSale_erp.html

@@ -841,7 +841,7 @@
     <div class="pro_management device">
         <div class="com_tab">
             <ul class="fl" style="width: 100%">
-                <li><a ui-sref="vendor_material_erp">企业产品库</a></li>
+                <li><a ui-sref="vendor_material_erp">公司产品库</a></li>
                 <li><a ui-sref="vendor_material_person_erp">个人产品库</a></li>
                 <li class="active"><a ui-sref="vendor_onSale_erp">在售产品</a></li>
                 <li><a ui-sref="vendor_undercarriage_erp">上下架历史</a></li>

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/erp/vendor_undercarriage_erp.html

@@ -553,7 +553,7 @@
     <div class="pro_management device">
         <div class="com_tab">
             <ul class="fl" style="width: 100%">
-                <li><a ui-sref="vendor_material_erp">企业产品库</a></li>
+                <li><a ui-sref="vendor_material_erp">公司产品库</a></li>
                 <li><a ui-sref="vendor_material_person_erp">个人产品库</a></li>
                 <li><a ui-sref="vendor_onSale_erp">在售产品</a></li>
                 <li class="active"><a ui-sref="vendor_undercarriage_erp">上下架历史</a></li>

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/seekPurchase.html

@@ -825,7 +825,7 @@
                             <div class="il-box-small il-box">
                                 <!--<div title="{{seek.encapsulation}}" class="item"><span>封装:</span>{{seek.encapsulation || '-'}}</div>-->
                                 <!--<div title="{{seek.produceDate}}" class="item"><span>生产日期:</span>{{seek.produceDate || '-'}}</div>-->
-                                <div title="{{seek.needquantity}}" class="item">{{seek.needquantity || '-'}}</div>
+                                <div title="{{seek.needQty || seek.needquantity}}" class="item">{{seek.needQty || seek.needquantity || '-'}}</div>
                                 <!--<div title="{{seek.currency + seek.unitPrice | currencyStr}}" class="item"><span>单价预算:</span>{{seek.currency + seek.unitPrice | currencyStr}}</div>-->
                             </div>
                         </div>

+ 2 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -1947,7 +1947,7 @@
 	<div class="pro_management device">
 		<div class="com_tab" style="margin-bottom: 10px">
 			<ul class="fl" style="width: 100%">
-				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">企业产品库</a></li>
+				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">公司产品库</a></li>
 				<li ng-class="{'active': tab == 'material_person'}"><a ui-sref="vendor_material_person">个人产品库</a></li>
 				<li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
 				<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>
@@ -2483,7 +2483,7 @@
 						<!--<strong class="text-inverse">*</strong>商城暂未收录的 品牌/器件,”原厂型号“将会显示为空且不可上架售卖,<br/>-->
 						<!--如需上架可先点击 【匹配】按钮,若匹配不成功,可前往<a ui-sref="vendor_brand_apply" target="_blank"> 品牌申请/</a><a ui-sref="vendor_component_apply" target="_blank">器件申请</a>,提出申请-->
 					<!--</div>-->
-					<div class="tip">* 上架成功30分钟后,方可被客户搜索到,并在企业产品库展示。</div>
+					<div class="tip">* 上架成功30分钟后,方可被客户搜索到,并在公司产品库展示。</div>
 					<div ng-if="currenctMaterial.length != 0">显示 {{(param.page - 1) * 10 + 1}}-
 						<span ng-if="param.currentPage == materialAll.totalPages" ng-bind="materialAll.totalElements"></span>
 						<span ng-if="param.currentPage != materialAll.totalPages" ng-bind="param.page * param.count"></span>, 共: <span ng-bind="materialAll.totalElements" style="color: #5078cb;"></span> 个</div>

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/vendor_material_person.html

@@ -1810,7 +1810,7 @@
 	<div class="pro_management device">
 		<div class="com_tab">
 			<ul class="fl" style="width: 100%">
-				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">企业产品库</a></li>
+				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">公司产品库</a></li>
 				<li ng-class="{'active': tab == 'material_person'}"><a ui-sref="vendor_material_person">个人产品库</a></li>
 				<li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
 				<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>

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

@@ -957,7 +957,7 @@
     <div class="pro_management device">
         <div class="com_tab">
             <ul class="fl" style="width: 100%">
-                <li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">企业产品库</a></li>
+                <li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">公司产品库</a></li>
                 <li ng-class="{'active': tab == 'material_person'}"><a ui-sref="vendor_material_person">个人产品库</a></li>
                 <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
                 <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>
@@ -1194,8 +1194,8 @@
                                         <div class="edit-img">
                                             <a ng-click="commodity.editPic = null" class="delete-img" title="删除" ng-if="commodity.editPic"><i class="fa fa-trash"></i></a>
                                             <a ng-click="editGoodsPicture(commodity.editPic || 'static/img/store/common/default.png', commodity)" title="修改图片"><img src="static/img/icon/update-img.png" /></a>
-
                                         </div>
+                                        <!--<a ng-click="editRegulPicture(commodity.Regulpic || 'static/img/store/common/default.png', commodity)">规格书</a>-->
                                     </div>
                                     <div class="fr wid135">
                                         <p>品牌: <em ng-bind="commodity.brandNameEn" title="{{commodity.brandNameEn}}">NXP</em></p>

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/vendor_undercarriage.html

@@ -576,7 +576,7 @@
     <div class="pro_management device">
         <div class="com_tab">
             <ul class="fl" style="width: 100%">
-                <li ng-class="{'active': tab == 'vendor_material'}"><a ui-sref="vendor_material">企业产品库</a></li>
+                <li ng-class="{'active': tab == 'vendor_material'}"><a ui-sref="vendor_material">公司产品库</a></li>
                 <li ng-class="{'active': tab == 'material_person'}"><a ui-sref="vendor_material_person">个人产品库</a></li>
                 <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
                 <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>

+ 2 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_upload.html

@@ -533,7 +533,7 @@
                 <li ng-class="{'active': $$productOn.tab == 'bathOnPerson'}" ng-click="toggleActive('bathOnPerson')"><a href="">导入个人库</a></li>
             </ul>
             <ul class="fl" style="width: 100%" ng-if="isPcbStore">
-                <li><a ui-sref="vendor_material">企业产品库</a></li>
+                <li><a ui-sref="vendor_material">公司产品库</a></li>
                 <li><a ui-sref="vendor_material_person">个人产品库</a></li>
                 <li><a ui-sref="vendor_onSale">在售产品</a></li>
                 <li><a ui-sref="vendor_undercarriage">上下架历史</a></li>
@@ -701,7 +701,7 @@
                         <div style="margin-top: -40px;" ng-if="$$productOn.tab == 'bathOn'">3、如核对信息无误之后,点击确认发布</div>
                         <div>
                             <span class="blue-bg publish" href="javascript:void(0)" ng-click="publish($event)" ng-disabled="!pageParams.totalElements" ng-show="$$productOn.tab == 'bathOn'"><span>确认上架</span></span>
-                            <b class="tip" ng-show="$$productOn.tab == 'bathOn'">* 上架成功30分钟后,方可被客户搜索到,并在企业产品库展示。</b>
+                            <b class="tip" ng-show="$$productOn.tab == 'bathOn'">* 上架成功30分钟后,方可被客户搜索到,并在公司产品库展示。</b>
                         </div>
                     </div>
                 </div>

+ 178 - 0
src/main/webapp/resources/view/vendor/modal/edit_regul_modal.html

@@ -0,0 +1,178 @@
+<!--修改图片-->
+<style>
+  .modal-dialog{
+    width: 535px;
+    height: 345px;
+  }
+  .update-img{
+    width: 520px;
+    height: 324px;
+  }
+  .update-img .update-big-img{
+    width: 265px;
+    float: left;
+    margin-top: 5px;
+  }
+  .update-img .update-big-img p{
+    line-height: 30px;
+    font-size: 14px;
+  }
+  .update-img .update-big-img .previewImage{
+    width: 256px;
+    height: 256px;
+    overflow: hidden;
+    line-height: 256px;
+    border: #e6e6e6 1px solid;
+    margin-bottom: 5px;
+  }
+  .update-img .update-big-img .previewImage img{
+    width: 256px;
+    height: 256px;
+  }
+  .update-img .update-file-btn{
+    width: 244px;
+    float: left;
+    margin-left: 3px;
+  }
+  .update-img .update-file-btn p{
+    line-height: 30px;
+    position: relative;
+    text-align: center;
+    margin-top: 8px;
+    height: 30px;
+  }
+  .update-img .update-file-btn p input{
+    width: 80px;
+    height: 30px;
+    z-index: 10;
+    position: absolute;
+    left: 0;
+    top: 0;
+    opacity: 0;
+  }
+  .update-img .update-file-btn p span{
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 80px;
+    display: inline-block;
+    height: 30px;
+    text-align: center;
+    font-size: 14px;
+    line-height: 30px;
+    background: #bebbbb;
+    z-index: 9;
+  }
+  .update-img .update-file-btn p a{
+    width: 70px;
+    display: inline-block;
+    height: 30px;
+    line-height: 30px;
+    text-align: center;
+    font-size: 14px;
+  }
+  .update-img .update-file-btn p a.off{
+    background: #bebbbb;
+    float: left;
+  }
+  .update-img .update-file-btn p a.ok{
+    background: #5078cb;
+    color: #fff;
+    float: right;
+    margin-right: 44px;
+  }
+  .update-img .update-file-btn p a:hover,.update-img .update-file-btn p span:hover{
+    background: #3f7ae3;
+    color: #fff;
+    cursor: pointer;
+  }
+  .uploadImage{
+    width: 100%;
+    height: 30px;
+    z-index: 10;
+    position: absolute;
+    left: 0;
+    top: 0;
+    opacity: 0;
+  }
+  .update-file-btn .previewImage{
+    width: 100%;
+    height: 30px;
+  }
+  .update-file-btn .previewImage:hover{
+    cursor: pointer;
+  }
+  .close{
+    position: absolute;
+    top: 0;
+    right: 5px;
+  }
+  .modal-body{
+    padding: 10px;
+  }
+  .file-text{
+    width: 100%;
+    margin: 0 auto;
+    margin-top: 35px;
+  }
+  .file-text h3{
+    line-height: 26px;
+    background: #e3e3e6;
+    font-size: 12px;
+    text-align: center;
+    font-weight: bold;
+  }
+  .file-text div{
+    width: 100%;
+    height: 215px;
+    background: #f6f6f7;
+    line-height: 20px;
+    font-size: 12px;
+    padding: 5px 10px;
+  }
+  .prompt{
+    font-size: 12px;
+    width: 270px;
+    display: inline-block;
+    margin-top: 5px;
+  }
+</style>
+<div class="modal-head"></div>
+<div class="modal-body">
+  <div class="view-box">
+    <div class="update-img">
+      <a ng-click="cancel()" class="close">&times;</a>
+      <div class="update-big-img">
+        <p>大图预览</p>
+        <div class="previewImage">
+          <a href="{{Regulpic}}" target="_blank" ng-if="Regulpic != ''"><img ng-src="{{Regulpic}}" alt="商品图片"></a>
+          <img ng-src="{{Regulpic}}" alt="商品图片" ng-if="!Regulpic">
+        </div>
+        <span class="prompt"><em style="color: #f00;">*</em>  建议使用不小于256*256px图片,大小不超过3M</span>
+      </div>
+      <div class="update-file-btn">
+        <div class="file-text">
+          <h3>图片上传须知</h3>
+          <div>上传的商品图片若存在以下任一情形,
+            平台将会对产品进行下架,若情节影响
+            严重,平台将保留追究权:<br/>
+            1、图片与产品不相符合;<br/>
+            2、图片存在低俗信息;<br/>
+            3、图片拼接、不清晰或拉伸变形等;<br/>
+            4、带有文字、色块、图形或logo等影响<br/>
+            &nbsp;&nbsp;&nbsp;主图美观和正常查看的内容(平台会<br/>
+            &nbsp;&nbsp;&nbsp;自动生成店铺logo,无需再使用有logo<br/>
+            &nbsp;&nbsp;&nbsp;的图片).
+          </div>
+        </div>
+        <p>
+                        <span style="left:40px;">
+                            <input type="file" image-upload class="uploadImage" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf" on-success="onUploadSuccess($data, $file)" non-preview="true">
+                            <span>选择文件</span>
+                        </span>
+          <a ng-click="confirm()" class="ok">确定</a>
+        </p>
+      </div>
+    </div>
+  </div>
+</div>