Browse Source

Merge branch 'feature-201835-wangcz' into dev

wangcz 7 years ago
parent
commit
50e2e5f688

+ 12 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java

@@ -42,7 +42,18 @@ import java.util.List;
  *
  */
 @Entity
-@Table(name = "trade$goods", indexes = { @Index(name = "trade_goods_cmpuuid_index", columnList = "cmp_uuid"), @Index(name = "goods_reserve_index", columnList = "go_reserve"), @Index(name = "goods_status_index", columnList = "go_status"), @Index(name = "goods_code_index", columnList = "cmp_code")})
+@Table(name = "trade$goods", indexes = {
+		@Index(name = "goods_cmpuuid_index", columnList = "cmp_uuid"),
+        @Index(name = "goods_reserve_index", columnList = "go_reserve"),
+        @Index(name = "goods_status_index", columnList = "go_status"),
+        @Index(name = "goods_code_index", columnList = "cmp_code"),
+        @Index(name = "goods_createddate_index", columnList = "go_createddate"),
+        @Index(name = "goods_storename_index", columnList = "go_storename"),
+        @Index(name = "goods_enuu_index", columnList = "go_enuu"),
+        @Index(name = "goods_kinduuid_index", columnList = "go_kind_uuid"),
+        @Index(name = "goods_storeid_index", columnList = "go_storeid"),
+		@Index(name = "goods_productid_index", columnList = "go_productid")
+})
 @Cacheable
 @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "com.uas.platform.b2c.prod.commodity.model.Goods")
 public class Goods implements Serializable {

+ 4 - 1
src/main/java/com/uas/platform/b2c/prod/store/model/StoreApply.java

@@ -12,6 +12,7 @@ import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
+import javax.persistence.Index;
 import javax.persistence.Table;
 import javax.persistence.Transient;
 import java.util.Collections;
@@ -25,7 +26,9 @@ import java.util.List;
  * @version 2017-08-02 14:37:25 创建文件
  */
 @Entity
-@Table(name = "store$apply")
+@Table(name = "store$apply", indexes = {
+		@Index(name = "store$apply_status_index", columnList = "apply_status")
+})
 @JsonInclude(JsonInclude.Include.NON_EMPTY)
 public class StoreApply {
 

+ 17 - 12
src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreApplyServiceImpl.java

@@ -8,7 +8,14 @@ import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.UuidUtils;
 import com.uas.platform.b2c.prod.store.dao.StoreApplyDao;
 import com.uas.platform.b2c.prod.store.dao.StoreBrandInfoDao;
-import com.uas.platform.b2c.prod.store.model.*;
+import com.uas.platform.b2c.prod.store.model.EnterpriseSimple;
+import com.uas.platform.b2c.prod.store.model.Qualification;
+import com.uas.platform.b2c.prod.store.model.QualificationType;
+import com.uas.platform.b2c.prod.store.model.StoreApply;
+import com.uas.platform.b2c.prod.store.model.StoreBrandInfo;
+import com.uas.platform.b2c.prod.store.model.StoreIn;
+import com.uas.platform.b2c.prod.store.model.StoreInfoAndProdExport;
+import com.uas.platform.b2c.prod.store.model.StoreType;
 import com.uas.platform.b2c.prod.store.service.StoreApplyService;
 import com.uas.platform.b2c.prod.store.service.StoreInService;
 import com.uas.platform.b2c.trade.support.CodeType;
@@ -19,10 +26,8 @@ import com.uas.platform.core.persistence.criteria.CriterionExpression;
 import com.uas.platform.core.persistence.criteria.LogicalExpression;
 import com.uas.platform.core.persistence.criteria.SimpleExpression;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.convert.converter.Converter;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
-import org.springframework.data.domain.Sort;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -334,26 +339,26 @@ public class StoreApplyServiceImpl implements StoreApplyService {
 				+ "a.apply_store_enuu enuu,a.apply_auth_time agreeTime, a.apply_auth_person_name agreeName, "
 				+ "ifnull(p.count, 0) count from `store$apply` a left join (select pr_enuu, count(1) count from products");
 		if (!StringUtils.isEmpty(startTime)) {
-			sql.append(" where date(pr_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
+			sql.append(" where pr_create_time >= '" + new java.sql.Date(startTime.getTime()) + "'");
 		}
 		if (!StringUtils.isEmpty(endTime) && !StringUtils.isEmpty(startTime)) {
-			sql.append(" and date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
+			sql.append(" and pr_create_time <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
 		if (!StringUtils.isEmpty(endTime) && StringUtils.isEmpty(startTime)) {
-			sql.append(" where date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
+			sql.append(" where pr_create_time <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
 		sql.append(" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS'  and count > 0 "
 				+ "order by a.apply_create_time limit " + (pageable.getPageNumber() - 1) * pageable.getPageSize() + ","
 				+ pageable.getPageSize());
 		StringBuilder totalSql = new StringBuilder("select count(1) from `store$apply` a left join (select pr_enuu, count(1) count from products ");
 		if (!StringUtils.isEmpty(startTime)) {
-			totalSql.append(" where date(pr_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
+			totalSql.append(" where pr_create_time >= '" + new java.sql.Date(startTime.getTime()) + "'");
 		}
 		if (!StringUtils.isEmpty(endTime) && !StringUtils.isEmpty(startTime)) {
-			totalSql.append(" and date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
+			totalSql.append(" and pr_create_time <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
 		if (!StringUtils.isEmpty(endTime) && StringUtils.isEmpty(startTime)) {
-			totalSql.append(" where date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
+			totalSql.append(" where pr_create_time <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
 		totalSql.append(" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' and count > 0 ");
 		Integer total = commonDao.queryForObject(totalSql.toString(), Integer.class);
@@ -367,13 +372,13 @@ public class StoreApplyServiceImpl implements StoreApplyService {
 				+ "a.apply_store_enuu enuu,a.apply_auth_time agreeTime, a.apply_auth_person_name agreeName, "
 				+ "ifnull(p.count, 0) count from `store$apply` a left join (select pr_enuu, count(1) count from products");
 		if (!StringUtils.isEmpty(startTime)) {
-			sql.append(" where date(pr_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
+			sql.append(" where pr_create_time >= '" + new java.sql.Date(startTime.getTime()) + "'");
 		}
 		if (!StringUtils.isEmpty(endTime) && !StringUtils.isEmpty(startTime)) {
-			sql.append(" and date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
+			sql.append(" and pr_create_time <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
 		if (!StringUtils.isEmpty(endTime) && StringUtils.isEmpty(startTime)) {
-			sql.append(" where date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
+			sql.append(" where pr_create_time <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
 		sql.append(" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' and count > 0 "
 				+ "order by a.apply_create_time  ");

+ 1 - 1
src/main/webapp/resources/js/sso/controllers/rolePermissionCtrl.js

@@ -7,7 +7,7 @@ define(['app/app'], function (app) {
     app.register.controller('rolePermissionCtrl', ['$scope', '$rootScope', 'Enterprise', 'User', 'toaster', '$modal', 'BaseService', 'ngTableParams', '$http', 'AuthenticationService', '$stateParams','AccountResource','AccountRole', 'Authority', 'B2bAccountRole', 'B2bAccountUser', function ($scope, $rootScope, Enterprise, User, toaster, $modal, BaseService, ngTableParams, $http, AuthenticationService, $stateParams, AccountResource, AccountRole, Authority, B2bAccountRole, B2bAccountUser) {
         $rootScope.active = 'sso_permission';
         document.title = '角色权限';
-        $scope.tab = 'b2c';
+        $scope.tab = 'b2b';
         $scope.addingUser = false;
         $scope.setAddingUser = function (status) {
             $scope.addingUser = status;

+ 6 - 0
src/main/webapp/resources/js/usercenter/app.js

@@ -459,6 +459,12 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
             templateUrl : 'static/view/usercenter/forstore/product_upload.html',
             controllerUrl : "app/controllers/forstore/product_upload_ctrl",
             controller : 'productUploadCtrl'
+        })).state('single_entry', angularAMD.route({
+            url: "/single_entry",
+			title: '产品录入',
+            templateUrl: "static/view/usercenter/forstore/single_entry.html",
+            controller: 'singleEntryCtrl',
+            controllerUrl: 'app/controllers/forstore/single_entry_ctrl'
         })).state('buyer_material', angularAMD.route({
             title : '物料资料产品管理部分',
             url : '/buyer_material',

+ 718 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/single_entry_ctrl.js

@@ -0,0 +1,718 @@
+define(['app/app', 'jquery-uploadify'], function(app) {
+  'use strict';
+  app.register.controller('singleEntryCtrl', ['$scope', 'Loading', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', '$location', '$stateParams', 'Search', '$modal', 'ComponentActiveAPI', 'BrandSubmit', 'BrandActiveAPI', 'DistributionRule', 'prodRepositoryService', 'AuthenticationService', 'StoreInfo', 'ProductServiceQuery', 'StoreCms', 'ByteCountService', 'Goods', 'UASBatchPutOnPropertyServices', '$filter', '$upload', '$http', function($scope, Loading, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService, $location, $stateParams, Search, $modal, ComponentActiveAPI, BrandSubmit, BrandActiveAPI, DistributionRule, prodRepositoryService, AuthenticationService, StoreInfo, ProductServiceQuery, StoreCms, ByteCountService, Goods, UASBatchPutOnPropertyServices, $filter, $upload, $http) {
+    $rootScope.active = 'product_upload';
+    document.title = '买家产品库-单个录入';
+    $scope.tab = 'single_entry';
+    $scope.packageArray = ["Bulk-散装", "Reel-卷装", "Tape/Reel-编带", "Tray-盘装", "Tube-管装", "盒装", "袋装", "罐装", "瓶装", "桶装", "箱装", "其他"];
+    $scope.batch = {};
+
+    function initInfo() {
+      $scope.Regul = {
+        packaging: '其他',
+        Regulpic: 'static/img/vendor/images/upload.png',
+        Ischange: false,
+        iniUrlImg: 'static/img/vendor/images/upload.png',
+        RegulImg: 'static/img/vendor/images/upload.png',
+        prices: [{'start': 1, rMBPrice: ''}],
+        minPackQty: 1,
+        minDelivery: 1,
+        maxDelivery: 10,
+        dateArea: 'formMe',
+        minBuyQty: 1,
+        breakUp: false
+      }
+    }
+    function initError() {
+      $scope.objError = {
+        pbranden: false,
+        kind: false,
+        pcmpcode: false,
+        spec: false,
+        minDelivery: false,
+        maxDelivery: false,
+        OnePrice: false,
+        minPackQty: false
+      }
+      for (var i = 0; i < $scope.Regul.prices.length; i++) {
+        $scope.Regul.prices[i].priceInvalid = false
+      }
+    }
+
+    initInfo()
+    initError()
+
+    //获取登录的信息
+    var getAuthentication = function () {
+      return AuthenticationService.getAuthentication().success(function(data) {
+        if(data && data.enterprises) {
+          data.enterprise = data.enterprises[data.enterprises.length - 1];
+          if(data.enterprises.length > 1) {
+            var enSelect = [];
+            angular.forEach(data.enterprises, function(e){
+              if(e.current)
+                data.enterprise = e;
+              else
+                enSelect.push(e);
+            });
+            data.enSelect = enSelect;
+          }
+        }
+        $rootScope.userInfo = data;
+      }).error(function(response) {
+        toaster.pop('info', '获取定单的信息' + response);
+      });
+    };
+    //判断是否是商城管理公司,是否可以选择自营。
+    $q.all([getAuthentication()]).then(function() {
+      //获取店铺的信息
+      StoreInfo.getStoreInfoByEnuu({enUU : $rootScope.userInfo.enterprise.uu}, function(data) {
+        $scope.storeInfo = data;
+        if(!data.uuid || data.storeName.indexOf('优软测试二') > -1 || data.storeName.indexOf('优软商城') > -1) {
+          $scope.batch.sellType = 'UAS';
+          $scope.batch.selfSellEabled = false;
+        }else {
+          $scope.batch.sellType = 'self';
+          $scope.batch.selfSellEabled = true;
+        }
+        var selfSale = ($scope.storeInfo.uuid != 'undefind' && $scope.storeInfo.uuid !== '33069557578d44e69bd91ad12d28a8d4' && ($scope.storeInfo.storeName && $scope.storeInfo.storeName.indexOf('优软测试二') < 0 && $scope.storeInfo.storeName.indexOf('优软商城') < 0)) ? 1: 0
+        $scope.Regul.dateArea = selfSale === 1 ? 'formMe' : 'autoMonth' // 自营还是销售
+        // 销售方式
+
+        $scope.Regul.selfSale = selfSale
+      }, function(response) {
+        toaster.pop('error', '获取店铺的信息失败, ' + response.data);
+      });
+    });
+
+    // 品牌change事件
+    $scope.onBrandChange = function(brand, index) {
+      $rootScope.singleEntryInfo = true
+      $scope.objError.pbranden = false
+      if (index === undefined) {
+        if (brand === '') {
+          $scope.Regul.BrandList = []
+          return false
+        }
+        $scope.Regul.BrandList = $scope.getSimilarBrands(brand).$$state
+      } else {
+        if (brand && getRealLen(brand) > 50) {
+          $scope.replaceMaterialList[index].ptrBranden = cutOutString(brand,
+              50);
+        } else if ((/[^\x00-\xff]/g).test(brand)) {
+          var chineseIndex = -1;
+          for (var i = 0; i < brand.length; i++) {
+            if ((/[^\x00-\xff]/g).test(brand.charAt(i))
+                && !(/[\u4e00-\u9fa5]/).test(brand.charAt(i))) {
+              chineseIndex = i;
+              break;
+            }
+          }
+          if (chineseIndex > -1) {
+            $scope.replaceMaterialList[index].ptrBranden = brand.substring(0,
+                chineseIndex);
+          }
+        } else {
+          if (!brand) {
+            $scope.setShowSimilarBrandList(false, index);
+          } else {
+            $scope.getSimilarBrand(brand, index);
+          }
+        }
+      }
+    }
+
+    $scope.RegulKindBlur  = function() {
+      $rootScope.singleEntryInfo = true
+      $scope.objError.kind = false
+    }
+
+    /**
+     * 物料编辑品牌输入框失去焦点
+     *
+     * @param name    品牌名称
+     */
+    $scope.RegulonBrandBlur = function(name) {
+      $rootScope.singleEntryInfo = true
+      // setTimeout(function() {
+        if (name === '') {
+          $scope.Regul.BrandList = []
+        } else {
+          $scope.Regul.pbranden = $scope.Regul.BrandList && $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) {
+      $rootScope.singleEntryInfo = true
+      if (index === undefined) {
+        $scope.Regul.pbranden = brand
+        $scope.Regul.BrandList = []
+      } else {
+        $scope.replaceMaterialList[index].ptrBranden = brand;
+        $scope.setShowSimilarBrandList(false, index);
+      }
+    }
+
+    // 获取品牌联想词
+    $scope.getSimilarBrands = function(keyword) {
+      if (keyword) {
+        return Search.getSimilarBrands({
+          keyword: keyword
+        }).$promise.then(function(data) {
+          return data.map(function(item) {
+            return item;
+          });
+        });
+      }
+    }
+    ;
+
+    $scope.onCodeChange = function(code, index) {
+      $rootScope.singleEntryInfo = true
+      $scope.objError.pcmpcode = false
+      if (index === undefined) {
+        if (code === '') {
+          $scope.Regul.CodeList = []
+          return false
+        }
+        if ((/[^\x00-\xff]/g).test(code)) {
+          $scope.Regul.pcmpcode = ''
+          $scope.Regul.CodeList = []
+          return false
+        }
+        $scope.Regul.CodeList = getSimilarCode(code).$$state
+      }
+    }
+    /**
+     * 编辑物料型号输入框失去焦点
+     *
+     * @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].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) {
+      $rootScope.singleEntryInfo = true
+        $scope.Regul.pcmpcode = code.pcmpcode
+
+      $scope.Regul.pbranden = code.pbranden
+      $scope.Regul.spec = code.spec
+      $scope.Regul.kind = code.kind
+      $scope.Regul.CodeList = []
+    }
+
+    var countLength = function(string) {
+      return string.replace(/[^\x00-\xff]/g, '**').length;
+    };
+    /**
+     * 获取型号联想词
+     *
+     * @param name    品牌名称
+     */
+    function getSimilarCode(name) {
+      if (name) {
+        return Material.getSimilarComponents({keyword: name}).$promise.then(
+            function (data) {
+              console.log(data)
+              return data.map(function (item) {
+                return item;
+              });
+            });
+      }
+    }
+    var cutOutString = function(str, length) {
+      for (var i = 1; i <= str.length; i++) {
+        if (countLength(str.substr(0, i)) > length) {
+          str = str.substr(0, i - 1);
+          break;
+        }
+      }
+      return str;
+    };
+
+    $scope.showClickText = function(goods, item) {
+      goods.packaging = item;
+    }
+
+    $scope.setPriceMinPackAmount = function(num) {
+      $rootScope.singleEntryInfo = true
+      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) {
+      $rootScope.singleEntryInfo = true
+      if (num && num.indexOf('.') > -1) {
+        toaster.pop('warning', '提示', '库存数量不能存在小数点')
+        $scope.Regul.reserve = 1
+      } else {
+        $scope.Regul.reserve = num
+      }
+      $scope.objError.reserve = false
+    }
+
+    $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
+    };
+
+    // 删除规格书
+    $scope.deleteRegulImg = function(pom) {
+      $scope.Regul[pom] = 'static/img/vendor/images/upload.png'
+      $scope.Regul.Ischange = false
+    }
+
+    // 修改物料图片
+    $scope.onUploadSuccessProduct = function(data) {
+      $scope.Regul.RegulImg = data.path;
+    }
+
+    /*查看大图*/
+    $scope.showImg = function(imgUrl, event) {
+      console.log(1)
+      var src = imgUrl, box = $('#image-box'), modal = $('.modal-content');
+      box.show();
+      box.find('img').attr('src', src);
+      box.find('a').click(function(){
+        box.hide();
+      });
+      box.dblclick(function(){
+        box.hide();
+      });
+    }
+
+    // 最小起订量修改 梯度1的值等于最小起订量
+    $scope.ProductupdateStartNumber = function(productUpOff) {
+      if (parseInt(productUpOff) >= parseInt($scope.Regul.prices[0].start)) {
+        $scope.Regul.prices[0].start = $scope.Regul.minPackQty
+        return false
+      }
+      $scope.Regul.prices[0].start = parseInt(productUpOff)
+    }
+    // 最小起订量失去焦点
+    $scope.ProductblurMinBuyQty = function(MinBuyQty) {
+      if (!MinBuyQty) return
+      if (!$scope.Regul.minBuyQty || $scope.Regul.minBuyQty === '') {
+        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
+          toaster.pop('warning', '提示', '不可拆卖时,起订量必须是包装数量的倍数');
+          $scope.ProductupdateStartNumber($scope.Regul.minBuyQty)
+        }
+      }
+    }
+
+    /**
+     * @param min 最小值
+     * @param max 最大值
+     * @param isMin 传入的是否是最小值
+     * @param commodity 批次信息
+     */
+    $scope.isInt = /^[0-9]*[1-9][0-9]*$/;
+    $scope.changeDelivery = function(min, max, isMin) {
+      var day = -1;
+      if (isMin) {
+        if (min && $scope.isInt.test(min)) {
+          day = min;
+        } else {
+          if (typeof min == 'undefined') {
+            return;
+          }
+          if (!$scope.isInt.test(min)) {
+            toaster.pop('warning', '提示', '交期请输入1-999的整数');
+            $scope.objError.minDelivery = true;
+          }
+          return;
+        }
+
+      } else {
+        if (max && $scope.isInt.test(max)) {
+          day = max;
+        } else {
+          if (typeof max == 'undefined') {
+            return;
+          }
+          if (!$scope.isInt.test(max)) {
+            toaster.pop('warning', '提示', '交期只能填写1-999之间的整数值');
+            $scope.objError.maxDelivery = true;
+          }
+          return;
+        }
+      }
+      if (day > 999 || day < 1) {
+        if (isMin) {
+          $scope.objError.minDelivery = true;
+        } else {
+          $scope.objError.maxDelivery = true;
+        }
+        toaster.pop('warning', '提示', '交期的值必须在1-999天');
+        return
+      }
+      if (Number(min) > Number(max)) {
+        $scope.objError.minDelivery = true;
+        $scope.objError.maxDelivery = true;
+        toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
+        return;
+      }
+      $scope.objError.minDelivery = false;
+      $scope.objError.maxDelivery = false;
+    }
+    ;
+
+    // 可拆卖 上下架开关
+    $scope.productToggleIsBreadUp = function(pom) {
+      $scope.Regul[pom] = !$scope.Regul[pom]
+      if (pom === 'breakUp') {
+        // 重置最小起订量
+        $scope.ProductblurMinBuyQty($scope.Regul.minBuyQty)
+      }
+    }
+
+    // 选择寄售还是自营
+    $scope.productChangeSelfType = function(num, _type) {
+      if ((!$scope.storeInfo.uuid || $scope.storeInfo.uuid === '33069557578d44e69bd91ad12d28a8d4') && _type === 'formMe'){
+        toaster.pop('warning','提示','您还未开店铺,不能选择自营')
+        $scope.Regul.dateArea = 'autoMonth'
+        return
+      }
+      $scope.Regul.dateArea = _type
+
+    }
+
+    /**
+     * 判断价格是否合理,只设置验证的结果
+     * @param prices 分段价格
+     * @param price 对应的价格
+     * @param index 索引
+     */
+    $scope.changePrices = function(prices, price, index) {
+      prices[index].priceInvalid = false;
+      if (!prices || !prices[index] || !price) {
+        return;
+      }
+      if (isNaN(price)) {
+        prices[index].priceInvalid = true;
+        toaster.pop('warning', '提示', '单价必须是大于0的数字');
+        return;
+      }
+      if (new Number(price) <= 0) {
+        prices[index].priceInvalid = true;
+        toaster.pop('warning', '提示', '单价必须是大于0的数字');
+        return;
+      }
+      if (price.toString().indexOf('.') > -1) {
+        var arr = price.toString().split(".");
+        if (arr[0].length > 4 || arr[1].length > 6) {
+          prices[index].priceInvalid = true;
+          return;
+        }
+      } else {
+        if (price.toString().toString().length > 4) {
+          prices[index].priceInvalid = true;
+          return;
+        }
+      }
+    }
+    ;
+    /**
+     * 删除对应的分段.
+     * @param commodity
+     */
+    $scope.productDeleteFragment = function(goods, index) {
+      if (index > -1 && index < goods.length) {
+        if (goods.length < 2) {
+          toaster.pop('warning', "提示", "商品至少需要一个分段");
+          return;
+        }
+        var price = goods.splice(index, 1)
+      }
+    }
+    ;
+
+    /**
+     * 增加对应的分段。
+     * @param commodity
+     */
+    $scope.productAddFragment = function(goods) {
+      if (goods.length > 2) {
+        toaster.pop('warning', "提示", "商品最多只能有三个分段");
+        return;
+      }
+      goods.push({rMBPrice: '', start: ''})
+
+    }
+    /**
+     * 分段失去焦点。
+     * @param commodity
+     */
+    $scope.productPriceInfoBlur = function(index, val) {
+      if (index > 0) {
+        if ($scope.Regul.prices[index].start <= $scope.Regul.prices[index - 1].start) {
+          toaster.pop('warning', '提示', '输入值会导致梯度重叠,请重新修改')
+          $scope.Regul.prices[index].start = ''
+          return
+        }
+        $scope.Regul.prices[index].start = val
+      } else {
+        $scope.Regul.prices[index].start = val
+      }
+    }
+
+
+    // $scope.objError = {
+    //   pbranden: false,
+    //   kind: false,
+    //   pcmpcode: false,
+    //   spec: false,
+    //   minDelivery: false,
+    //   maxDelivery: false
+    //   minBuyQty: false
+    // }
+    // 编辑上下架保存按钮
+    $scope.productSave = function() {
+      initError()
+
+      if ($scope.Regul.pbranden === '' || !$scope.Regul.pbranden) {
+        toaster.pop('warning','提示', '品牌为必填项')
+        $scope.objError.pbranden = true
+        return;
+      }
+      if ($scope.Regul.kind === '' || !$scope.Regul.kind) {
+        toaster.pop('warning','提示', '物料名称为必填项')
+        $scope.objError.kind = true
+        return;
+      }
+      if ($scope.Regul.pcmpcode === '' || !$scope.Regul.pcmpcode) {
+        toaster.pop('warning','提示', '型号为必填项')
+        $scope.objError.pcmpcode = true
+        return;
+      }
+      if ($scope.Regul.reserve === '' || !$scope.Regul.reserve) {
+        toaster.pop('warning','提示', '库存数量不能为空')
+        $scope.objError.reserve = true
+        return;
+      }
+
+      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.trim())) {
+        toaster.pop('warning','提示', '成本单价输入不正确')
+        $scope.objError.OnePrice = true
+        return;
+      }
+
+      if (!$scope.Regul.minBuyQty || $scope.Regul.minBuyQty === 0) {
+        toaster.pop('warning','提示', '最小起订量必须是大于0的数字')
+        $scope.objError.minBuyQty = true
+        return;
+      }
+      if (!$scope.Regul.minDelivery || !$scope.Regul.maxDelivery) {
+        toaster.pop('warning','提示', '交期不能为空')
+        if (!$scope.Regul.minDelivery) {
+          $scope.objError.minDelivery = true
+        }
+        if (!$scope.Regul.maxDelivery) {
+          $scope.objError.maxDelivery = true
+        }
+        return;
+      }
+      if ($scope.Regul.minDelivery > $scope.Regul.maxDelivery) {
+        toaster.pop('warning','提示','最小交期不能大于最大交期')
+        $scope.objError.minDelivery = true
+        return;
+      }
+      var flag = true
+      for (var i = 0; i < $scope.Regul.prices.length; i++) {
+        // if (!$scope.Regul.prices[i].start
+        //     || !$scope.Regul.prices[i].rMBPrice && $scope.storeInfo.enType !== 'HK' ) {
+        //   toaster.pop('warning', '提示', '价格梯度不能为空')
+        //   flag = false
+        //   $scope.Regul.prices[i].priceInvalid = true
+        //   break;
+        // }
+        // else if (!$scope.Regul.prices[i].start
+        //     || !$scope.Regul.prices[i].uSDPrice && $scope.storeInfo.enType === 'HK') {
+        //   toaster.pop('warning', '提示', '价格梯度不能为空')
+        //   flag = false
+        //   $scope.Regul.prices[i].priceInvalid = true
+        //   break;
+        // }
+        if ($scope.Regul.prices[i + 1] && Number($scope.Regul.prices[i].start) > Number($scope.Regul.prices[i + 1].start)) {
+          toaster.pop('warning','提示','输入值会导致梯度重叠,请重新修改')
+          flag = false
+          break;
+        }
+      }
+      if (!flag) {
+        return
+      }
+      if ($scope.Regul.prices.length === 1) {
+        if ($scope.storeInfo.enType === 'HK') {
+          $scope.Regul.prices[0].uSDNTPrice = ''
+          $scope.Regul.prices[0].end = '999999999'
+        }else {
+          $scope.Regul.prices[0].rMBNTPrice = ''
+          $scope.Regul.prices[0].end = '999999999'
+        }
+      } else {
+        for (var i = 0; i < $scope.Regul.prices.length; i++) {
+          if ($scope.storeInfo.enType === 'HK') {
+            $scope.Regul.prices[i].uSDNTPrice = ''
+            $scope.Regul.prices[i].end = '999999999'
+          }else {
+            $scope.Regul.prices[i].rMBNTPrice = ''
+            $scope.Regul.prices[i].end = '999999999'
+          }
+          if ($scope.Regul.prices[i + 1]) {
+            $scope.Regul.prices[i].end = parseInt(
+                $scope.Regul.prices[i + 1].start) - 1
+          }
+        }
+      }
+
+      // 先判断是自营店铺 还是 寄售店铺
+      // var _selfSale = $scope.productUpOff.goods.selfSale
+      if ($scope.storeInfo.uuid !== '33069557578d44e69bd91ad12d28a8d4') { // 如果是自营店铺
+        if ($scope.Regul.dateArea === 'formMe') { // 用户选择了自营
+          $scope.Regul.selfSale = 1
+        } else if ($scope.Regul.dateArea === 'autoMonth') { // 用户选择了寄售
+          $scope.Regul.selfSale = 0
+        }
+      }
+      var jsonObject = {
+        isPcb: $rootScope.isPcbStore ? 1 : 0,
+        goods: {},
+        product: {}
+      }
+      jsonObject.product = {
+        spec: $scope.Regul.spec, // 规格
+        minPackQty: $scope.Regul.minPackQty, // 最小包装量
+        erpReserve:  $scope.Regul.reserve, //库存
+        cmpCode: $scope.Regul.pcmpcode, //型号
+        brand: $scope.Regul.pbranden,//品牌
+        prodName: $scope.Regul.kind, // 名称
+        price: $scope.Regul.OnePrice, // 成本单价
+        attachment: $scope.Regul.Ischange ? $scope.Regul.Regulpic : '', // 规格书
+        cmpImg: $scope.Regul.RegulImg !== $scope.Regul.iniUrlImg ? $scope.Regul.RegulImg : '',// 图片
+        packaging: $scope.Regul.packaging // 包装方式
+      }
+      jsonObject.goods =  {
+        minBuyQty: $scope.Regul.minBuyQty, // 最小起订量
+        //分段报价信息
+        prices: $scope.Regul.prices,
+        breakUp: $scope.Regul.breakUp, // 是否拆卖
+        minDelivery: $scope.Regul.minDelivery, // 最短交期
+        maxDelivery: $scope.Regul.maxDelivery,//  最长交期
+        selfSale: $scope.Regul.selfSale, // 销售方式
+      }
+      $rootScope.singleEntryInfo = false
+      Material.importOneMaterail({}, jsonObject, function(data) {
+        if (data.code == 1) {
+          toaster.pop('success', '保存成功');
+          $scope.showProductInfo = true
+        } else {
+          toaster.pop('error', '失败', data.message);
+        }
+      }, function(response) {
+        toaster.pop('error', '失败', response.data);
+      });
+      // Goods.updateGoods(null, $scope.productUpOff.goods, function(data) {
+      //   if (data.code == 1) {
+      //     toaster.pop('success', '保存成功');
+      //     loadData()
+      //   } else {
+      //     toaster.pop('error', '失败', data.message);
+      //   }
+      // }, function(response) {
+      //   toaster.pop('error', '失败', response.data);
+      // });
+    }
+
+    // 新增物料
+    $scope.initProduct = function() {
+        resetPageInfo()
+        $scope.showProductInfo = false
+    }
+
+    // 取消编辑
+    $scope.clearCheckBox = function() {
+      if ($rootScope.singleEntryInfo === true ) {
+        if (confirm('是否放弃本次编辑')) {
+            $rootScope.singleEntryInfo = false
+            resetPageInfo()
+        }
+      } else {
+          resetPageInfo()
+      }
+    }
+
+    // 重置页面数据
+    function resetPageInfo() {
+        initInfo()
+        initError()
+        var selfSale = ($scope.storeInfo.uuid != 'undefind' && $scope.storeInfo.uuid !== '33069557578d44e69bd91ad12d28a8d4' && ($scope.storeInfo.storeName && $scope.storeInfo.storeName.indexOf('优软测试二') < 0 && $scope.storeInfo.storeName.indexOf('优软商城') < 0)) ? 1: 0
+        $scope.Regul.dateArea = selfSale === 1 ? 'formMe' : 'autoMonth' // 自营还是销售
+        // 销售方式
+        $scope.Regul.selfSale = selfSale
+    }
+
+    // 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)
+
+
+  }])
+});

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

@@ -906,8 +906,8 @@
 <div class="count user_right fr" ng-click="hideList()">
     <div class="com_tab">
         <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 == 'b2c'}" ng-click="setTab('b2c')"><a href="javascript:void(0)">商城角色</a></li>
         </ul>
     </div>
     <!--安全设置-->

+ 2 - 14
src/main/webapp/resources/view/usercenter/forstore/product_upload.html

@@ -531,21 +531,9 @@
     <div class="pro_management device">
         <div class="com_tab">
             <ul class="fl" style="width: 100%" ng-if="!isPcbStore">
-                <li ng-class="{'active': $$productOn.tab == 'bathOnPerson'}"><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>-->
+                <li ng-class="{'active': $$productOn.tab == 'bathOnPerson'}"><a>产品导入</a></li>
+                <li ng-class="{'active': $$productOn.tab == 'single_entry'}"><a ui-sref="single_entry">产品录入</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_person">个人产品库</a></li>-->
-                <!--<li><a ui-sref="vendor_onSale">在售产品</a></li>-->
-                <!--<li><a ui-sref="vendor_storage">出入库</a></li>-->
-                <!--<li><a ui-sref="vendor_undercarriage">上下架历史</a></li>-->
-                <!--<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">产品库</a></li>-->
-                <!--<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>-->
-            <!--</ul>-->
         </div>
         <div class="remind-line" ng-show="$$productOn.tab == 'bathOn' && showTip"><span class="fl">导入企业库的产品同时会进行上架销售并展示在店铺</span><a ng-click="closeTip()" class="fr">&times;</a></div>
         <!--<div class="remind-line" ng-show="$$productOn.tab == 'bathOnPerson' && showTip">-->

+ 536 - 0
src/main/webapp/resources/view/usercenter/forstore/single_entry.html

@@ -0,0 +1,536 @@
+<style>
+  .com_tab:nth-of-type(1) ul li::after {
+    background: url(/static/img/vendor/images/downicon.png);
+  }
+  .single_wrapper {
+    padding: 20px;
+    background: #fff;
+  }
+  .title-div {
+    border-left: 3px solid #5078cb;
+    padding-left: 5px;
+    font-size: 15px;
+    color: #5078cb
+  }
+  .clearfix::after {
+    clear: both;
+    zoom: 1;
+    display: block;
+    content: ' ';
+    visibility: hidden;
+  }
+  .w50 {
+    width: 50%
+  }
+  .red {
+    color: #f00505;
+  }
+  .single_wrapper .name {
+    font-size: 14px;
+    color: #333;
+    width: 140px;
+    line-height: 34px;
+    text-align: right;
+    margin-right: 10px;
+  }
+  .single_wrapper .textinput {
+    width: 330px;
+    line-height: 34px;
+    font-size: 14px;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    white-space: nowrap;
+  }
+  .single_wrapper .input input, .single_wrapper .input select{
+    width: 300px;
+  }
+  .single_wrapper .list {
+    margin-top: 14px;
+  }
+  .listUl {
+    position: absolute;
+    top: 34px;
+    left: 0px;
+    width: 100%;
+    max-height: 180px;
+    overflow-y: auto;
+    background: #fff;
+    border: 1px solid #dcdcdc;
+    z-index: 100;
+  }
+  .listUl li {
+    font-size: 14px;
+    color: #666;
+    line-height: 24px;
+    text-indent: 12px;
+  }
+  .listUl li:hover {
+    background: #dcdcdc;
+    cursor: pointer;
+  }
+  .uploadImage {
+    width: 100%;
+    height: 100%;
+    z-index: 10;
+    position: absolute;
+    left: 0;
+    top: 0;
+    opacity: 0;
+  }
+  .update-big-img .previewImage {
+    height: 78px;
+    width: 78px;
+    line-height: 78px;
+    text-align: center;
+    position: relative;
+    border: 1px solid #dcdcdc;
+    float: left
+  }
+  .update-big-img .prompt {
+    float: left;
+    font-size: 12px;
+    color: #999;
+    margin-left: 12px;
+    text-align: left
+  }
+  .update-big-img .prompt div {
+    line-height: 18px;
+  }
+
+  .update-big-img .previewImage img {
+    overflow: hidden;
+    line-height: 78px;
+    margin-bottom: 5px;
+    position: relative;
+    width: 100%;
+    height: 100%;
+  }
+  .cover {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    left: 0px;
+    top: 0px;
+    background: rgba(0,0,0,0.5);
+  }
+  .cover .fa-trash {
+    color: #fff;
+    font-size: 18px;
+    position: absolute;
+    right: 5px;
+    top: 5px;
+    cursor: pointer;
+  }
+  .single_top_wrapper {
+    border-bottom: 2px solid #f5f5f5;
+    margin-left: -20px;
+    margin-right: -20px;
+    padding-bottom: 20px
+  }
+  .danger {
+    /*outline: 1px solid #ed77de;*/
+    box-shadow: 0 0 5px #f00505;
+    border: 0px
+  }
+  .marginBottom14 {
+    margin-bottom: 14px;
+  }
+  .single_middle span.switch{
+    width:39px;
+    height: 14px;
+    display: inline-block;
+    padding-left: 0px;
+  }
+  .single_middle span.switch button{
+    border: none;
+    position: relative;
+    top: 2px;
+    left: 5px;
+    width: 39px;
+    height: 14px;
+    background: url(static/img/icon/check-off.png) no-repeat center;
+  }
+  .single_middle span.switch button.active{
+    background: url("static/img/icon/check-ok.png") no-repeat center;
+  }
+</style>
+<div class="user_right fr">
+  <div class="pro_management device">
+    <div class="com_tab">
+      <ul class="fl" style="width: 100%" ng-if="!isPcbStore">
+        <li><a ui-sref="product_upload">导入产品</a></li>
+        <li ng-class="{'active': tab == 'single_entry'}"><a>录入产品</a></li>
+      </ul>
+    </div>
+  </div>
+
+  <div class="single_wrapper">
+    <div class="single_top">
+      <div class="title-div" style="margin-bottom: 16px;">基本信息</div>
+      <div class="single_top_wrapper clearfix">
+        <div class="clearfix w50 fl list">
+          <div class="fl name">
+            <span class="red">*</span>品牌:
+          </div>
+          <!---->
+          <div class="fl input" style="position: relative" ng-show="!showProductInfo">
+            <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)" ng-mousedown="stopMounseDown($event)">
+                {{item.nameEn}}
+              </li>
+            </ul>
+          </div>
+          <div class="fl textinput" ng-show="showProductInfo">
+            {{Regul.pbranden || '-'}}
+          </div>
+        </div>
+        <div class="clearfix w50 fl list">
+          <div class="fl name">
+            <span class="red">*</span>物料名称:
+          </div>
+          <div class="fl input" style="position: relative" ng-show="!showProductInfo">
+            <input type="text"
+                   placeholder="请输入物料名称"
+                   ng-model="Regul.kind"
+                   ng-class="objError.kind ? 'danger' : '' "
+                   class="form-control inputText" maxlength="20"
+                   ng-blur="RegulKindBlur()"
+            />
+          </div>
+          <div class="fl textinput" ng-show="showProductInfo">
+            {{Regul.kind || '-'}}
+          </div>
+        </div>
+        <div class="clearfix w50 fl list">
+          <div class="fl name">
+            <span class="red">*</span>型号:
+          </div>
+          <div class="fl input" style="position: relative;"  ng-show="!showProductInfo">
+            <!--ng-blur="RegulonCodeBlur(Regul.pcmpcode)"-->
+            <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)" ng-mousedown="stopMounseDown($event)">
+                {{item.pcmpcode}}
+              </li>
+            </ul>
+          </div>
+          <div class="fl textinput" ng-show="showProductInfo">
+            {{Regul.kind || '-'}}
+          </div>
+        </div>
+        <div class="clearfix w50 fl list">
+          <div class="fl name">
+            规格:
+          </div>
+          <div class="fl input" style="position: relative;"  ng-show="!showProductInfo">
+            <input type="text"
+                   placeholder="请输入规格参数"
+                   ng-model="Regul.spec"
+                   ng-class="objError.spec ? 'danger' : '' "
+                   class="form-control inputText" maxlength="50"/>
+          </div>
+          <div class="fl textinput" ng-show="showProductInfo">
+            {{Regul.spec || '-'}}
+          </div>
+        </div>
+        <div class="clearfix w50 fl list">
+          <div class="fl name">包装方式:
+          </div>
+          <div class="fl input" ng-show="!showProductInfo">
+            <!-- 可编辑状态 -->
+            <select ng-model="Regul.packaging"  class="select-adder select-package form-control" title="包装">
+              <option ng-repeat="item in packageArray" ng-click="showClickText(Regul, item)">{{item}}</option>
+            </select>
+          </div>
+          <div class="fl textinput" ng-show="showProductInfo">
+            {{Regul.packaging || '-'}}
+          </div>
+        </div>
+        <div class="clearfix w50 fl list">
+          <div class="fl name">
+            最小包装数(PCS):
+          </div>
+          <div class="fl input" ng-show="!showProductInfo">
+            <!-- 可编辑状态 -->
+            <input type="text"
+                   oninput="if(value.length>6)value=value.slice(0,6)"
+                   placeholder="请输入最小包装数"
+                   ng-model="Regul.minPackQty"
+                   onkeyup="this.value=this.value.replace(/\D|^0/g,'')" onafterpaste="this.value=this.value.replace(/\D|^0/g,'')"
+                   ng-blur="setPriceMinPackAmount(Regul.minPackQty)"
+                   class="form-control inputText" maxlength="50"
+                   ng-class="objError.minPackQty ? 'danger' : '' "
+            />
+          </div>
+          <div class="fl textinput" ng-show="showProductInfo">
+            {{Regul.minPackQty || '-'}}
+          </div>
+        </div>
+        <div class="clearfix w50 fl list">
+          <div class="fl name">
+            <span class="red">*</span>库存数量(PCS):
+          </div>
+          <div class="fl input" ng-show="!showProductInfo">
+            <!-- 可编辑状态 oninput="if(value.length>6)value=value.slice(0,6)" -->
+            <input type="text"
+                   placeholder="请输入库存数量"
+                   ng-model="Regul.reserve"
+                   ng-blur="setReserve(Regul.reserve)"
+                   class="form-control inputText" maxlength="9"
+                   ng-class="objError.reserve ? 'danger' : '' "/>
+          </div>
+          <div class="fl textinput" ng-show="showProductInfo">
+            {{Regul.reserve || '-'}}
+          </div>
+        </div>
+        <div class="clearfix w50 fl list">
+          <div class="fl name">
+            成本单价({{(!storeInfo.enType || storeInfo.enType === 'MAINLAND') ? '¥' : '$'}}):
+          </div>
+          <div class="fl input" ng-show="!showProductInfo">
+            <!-- 可编辑状态 oninput="if(value.length>6)value=value.slice(0,6)" -->
+            <input type="text"
+                   placeholder="请输入成本单价"
+                   ng-model="Regul.OnePrice"
+                   ng-blur="setOnePrice(Regul.OnePrice)"
+                   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 class="fl textinput" ng-show="showProductInfo">
+            {{Regul.OnePrice || '-'}}
+          </div>
+        </div>
+        <div class="clearfix w50 fl list">
+          <div class="fl name">
+            规格书:
+          </div>
+          <div class="fl input">
+            <div class="update-big-img clearfix">
+              <div class="previewImage">
+                <input ng-show="!Regul.Ischange && !showProductInfo" type="file" image-upload class="uploadImage" accept=".pdf"  on-success="onUploadSuccess($data, $file)" max-size="20971520" errorSizeMsg="'文件大小不能超过20M'">
+                <img ng-src="{{Regul.Ischange ? 'static/img/vendor/images/pdf.png' : Regul.Regulpic}}" alt="商品图片" style="height: 78px;width: 78px;">
+                <div class="cover" ng-show="(Regul.Regulpic != Regul.iniUrlImg) && !showProductInfo"  style="background: rgba(0,0,0,0)">
+                  <i class="fa fa-trash" style="z-index: 98" ng-click="deleteRegulImg('Regulpic')"></i>
+                </div>
+                <a style="transition: 0s all" href="{{Regul.Regulpic}}" target="_blank" ng-show="Regul.Regulpic != Regul.iniUrlImg">
+                  <div class="cover">
+                    <div class="look" style="color: #fff;"><i class="fa fa-search"></i>查看</div>
+                  </div>
+                </a>
+              </div>
+              <div class="prompt">
+                <div><em style="color: #f00;">*</em>仅允许上传PDF格式文件,大小不超过20M</div>
+                <div><em style="color: #f00;">*</em>规格书上传后,将在两个工作日完成审核</div>
+                <div><em style="color: #f00;">*</em>如审核不通过,将会以消息的形式通知您</div>
+                <div><em style="color: #f00;">*</em>已有原厂规格书的器件暂不开放上传</div>
+                <div><em style="color: #f00;">*</em>更新规格书需重新审核</div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="clearfix w50 fl list">
+          <div class="fl name">
+            物料图片:
+          </div>
+          <div class="fl input">
+            <div class="update-big-img clearboth">
+              <div class="previewImage">
+                <input type="file" ng-show="!showProductInfo" image-upload class="uploadImage" on-success="onUploadSuccessProduct($data, $file)" max-size="1048576" error-size-msg="文件大小不能超过1M">
+                <img ng-src="{{Regul.RegulImg}}" alt="商品图片" style="height: 78px;width: 78px;">
+                <div class="cover" style="background: rgba(0,0,0,0)" ng-show="Regul.RegulImg != Regul.iniUrlImg && !showProductInfo">
+                  <i class="fa fa-trash" style="z-index: 98" ng-click="deleteRegulImg('RegulImg')"></i>
+                </div>
+                <div class="cover" style="z-index: 10;cursor:pointer" ng-show="Regul.RegulImg != Regul.iniUrlImg" ng-click="showImg(Regul.RegulImg, $event)">
+                  <div class="look" style="color: #fff;"><i class="fa fa-search"></i>查看</div>
+                </div>
+              </div>
+              <div class="prompt">
+                <div><em style="color: #f00;">*</em>支持JPG、PNG格式文件,大小不超过1M</div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="single_middle">
+      <!--<div class="title-div" style="margin-top: 20px;">销售信息</div>
+      <div class="single_middle single_top_wrapper clearfix">
+        <div class="w50 fl list">
+          <div class="clearfix marginBottom14">
+            <div class="fl name">最小起订量(PCS):
+            </div>
+            <div class="fl input" style="position: relative" ng-show="!showProductInfo">
+              <input type="text"
+                     placeholder="请输入最小起订量"
+                     maxlength="6"
+                     class="form-control inputText"
+                     oninput="if(value.length>6)value=value.slice(0,6)"
+                     ng-model="Regul.minBuyQty"
+                     ng-change="ProductupdateStartNumber(Regul.minBuyQty)"
+                     ng-blur="ProductblurMinBuyQty(Regul.minBuyQty)"
+                     ng-class="{'danger': objError.minBuyQty}"
+              />
+            </div>
+            <div class="fl textinput" ng-show="showProductInfo">
+              {{Regul.minBuyQty || '-'}}
+            </div>
+          </div>
+          <div class="clearfix marginBottom14">
+            <div class="fl name">交期(天):</div>
+            <div class="fl input" ng-show="!showProductInfo">
+              <input type="text"
+                     placeholder="天数"
+                     maxlength="3"
+                     class="form-control inputText"
+                     oninput="if(value.length>3)value=value.slice(0,3)"
+                     ng-model="Regul.minDelivery"
+                     ng-blur="changeDelivery(Regul.minDelivery, Regul.maxDelivery, true, productUpOff)"
+                     ng-class="{'error' : objError.minDelivery}"
+                     style="width: 144px;display: inline-block;"
+              />&nbsp;-&nbsp;<input type="text"
+                                    style="width: 144px;display: inline-block;"
+                                    placeholder="天数"
+                                    maxlength="3"
+                                    class="form-control inputText"
+                                    oninput="if(value.length>3)value=value.slice(0,3)"
+                                    ng-model="Regul.maxDelivery"
+                                    ng-blur="changeDelivery(Regul.minDelivery, Regul.maxDelivery, true, productUpOff)"
+                                    ng-class="{'danger' : objError.maxDelivery}"
+            />
+            </div>
+            <div class="fl textinput" ng-show="showProductInfo">
+              {{Regul.minDelivery}} - {{Regul.maxDelivery}}
+            </div>
+          </div>
+          <div class="clearfix marginBottom14">
+            <div class="fl name">可拆卖:</div>
+            <div class="fl" ng-show="!showProductInfo">
+              <span class="switch"><button ng-class="{'active' : Regul.breakUp}" ng-click="productToggleIsBreadUp('breakUp', false)"></button></span>
+            </div>
+            <div class="fl textinput" ng-show="showProductInfo">
+              {{Regul.breakUp ? '是': '否'}}
+            </div>
+          </div>
+          <div class="clearfix">
+            <div class="fl name">销售方式:</div>
+            <div class="fl" style="line-height: 34px;"  ng-show="!showProductInfo">
+              <label class="com-check-radio" style="margin-left: 5px;font-size: 14px">
+                <input type="radio" id="autoMonth0" ng-click="productChangeSelfType(1, 'formMe')" name="date" ng-model="Regul.dateArea" value="formMe">
+                <label style="vertical-align: middle;top:0px !important;" for="autoMonth0"></label>
+                自营
+              </label>
+              <label class="com-check-radio" style="margin-left: 10px;font-size: 14px">
+                <input type="radio" id="autoMonth1" ng-click="productChangeSelfType(2, 'autoMonth')" name="date"  ng-model="Regul.dateArea" value="autoMonth">
+                <label style="vertical-align: middle;top:0px !important;" for="autoMonth1"></label>
+                寄售
+              </label>
+            </div>
+            <div class="fl textinput" ng-show="showProductInfo">
+              {{Regul.dateArea === 'formMe' ? '自营': '寄售'}}
+            </div>
+          </div>
+        </div>
+        <div class="w50 fl list">
+          <li class="wuliao_list clearfix">
+            <div class="name pull-left">价格梯度:</div>
+            <div class="list pull-left" style="width: 280px;border: 1px solid #dcdcdc;margin-top: 0px">
+              <div style="background: #f1f3f6;font-size: 14px;color: #333;text-align: center;line-height: 34px;">
+                <span class="fl w50" style="width: 50%">分段数量(PCS)</span>
+                <span class="fl w50" style="width: 50%">分段价格({{storeInfo.enType !== 'HK' ? '¥' : '$'}})</span>
+                <div style="clear:both"></div>
+              </div>
+              <div class="plusBtn" style="font-size: 14px;color: #333;background: #fff;border-top: 1px solid #dcdcdc;position:relative" ng-repeat="price in Regul.prices">
+                <span class="fl w50" style="width: 50%;border-right:1px solid #dcdcdc" ng-show="!showProductInfo">
+                  <input text="text" style="width: 100%;outline: 0;border: 0;text-align: center;height: 30px" maxlength="9" ng-disabled="$index === 0" ng-readonly="$index === 0" ng-model="price.start" ng-blur="productPriceInfoBlur($index, price.start)" />
+                </span>
+                <span class="fl w50" style="text-align: center;border-right:1px solid #dcdcdc" ng-show="showProductInfo">
+                  {{price.start}}+
+                </span>
+                <span class="fl w50" style="width: 50%" ng-show="!showProductInfo">
+                  <input ng-show="storeInfo.enType !== 'HK'" type="text" autocomplete="off" validata-price ng-blur="changePrices(Regul.prices, price.rMBPrice, $index)" oninput="if(value.length>11)value=value.slice(0,11)" style="width: 100%;outline: 0;border: 0;text-align: center;height: 30px" ng-model="price.rMBPrice" />
+                  <input ng-show="storeInfo.enType === 'HK'" type="text" autocomplete="off" validata-price ng-blur="changePrices(Regul.prices, price.uSDPrice, $index)" oninput="if(value.length>11)value=value.slice(0,11)" style="width: 100%;outline: 0;border: 0;text-align: center;height: 30px" ng-model="price.uSDPrice" />
+                </span>
+                <span class="fl w50" ng-show="showProductInfo" style="text-align: center">
+                  {{price.rMBPrice || price.uSDPrice || '-'}}
+                </span>
+                <div style="clear:both"></div>
+                <div class="input-list ng-scope" style="height: 24px;line-height: 24px;position: absolute;right: -38px;top: 3px" ng-show="!showProductInfo">
+                  <a class="reduce" ng-disabled="Regul.prices.length < 2" ng-click="productDeleteFragment(Regul.prices, $index)" disabled="disabled"><i class="fa fa-minus-circle restrict-color" ng-class="{ 'restrict-color':Regul.prices.length === 1 }"></i></a>
+                  <a class="add" ng-click="productAddFragment(Regul.prices)" ng-disabled="Regul.prices.length >= 3"><i class="fa fa-plus-circle" ng-class="{ 'restrict-color': $index === 2 }"></i></a>
+                </div>
+              </div>
+            </div>
+          </li>
+        </div>
+      </div>-->
+      <div class="editRegulControll">
+        <div ng-click="clearCheckBox()" ng-show="!showProductInfo">取消</div>
+        <div ng-click="productSave()"  ng-show="!showProductInfo">确定</div>
+        <div ng-click="initProduct()" class="addProduct" ng-show="showProductInfo">新增</div>
+      </div>
+    </div>
+  </div>
+</div>
+<style>
+  div.plusBtn a.add[disabled] i, div.plusBtn a.reduce[disabled] i {
+    color: #c7c7c7 !important;
+    cursor: not-allowed;
+  }
+  .wuliao_list {
+    line-height: 28px;
+    margin-bottom: 10px;
+    font-size: 14px;
+  }
+  .wuliao_list .name {
+    margin-right: 5px;
+    /*width: 100px;*/
+    text-align: right;
+    color: #666;
+  }
+  .editRegulControll {
+    text-align: center;
+  }
+  .editRegulControll div {
+    width: 120px;
+    height: 36px;
+    line-height: 36px;
+    font-size: 16px;
+    color: #fff;
+    border-radius: 3px;
+    text-align: center;
+    background: #5078cb;
+    margin-right: 20px;
+    display: inline-block;
+    margin-top: 20px;
+    cursor: pointer;
+  }
+  .editRegulControll div:hover {
+    background: #4290f7
+  }
+  .editRegulControll div:first-child:hover {
+    background: #6b6b6b
+  }
+  .editRegulControll div:first-child {
+    background: #aaaaaa;
+  }
+  .editRegulControll div.addProduct {
+    background: #5078cb;
+  }
+  .editRegulControll div.addProduct:hover {
+    background: #4290f7
+  }
+</style>

+ 2 - 2
src/main/webapp/resources/view/usercenter/left_nav.html

@@ -39,8 +39,8 @@
                 <li ng-class="{'active' : active == 'seek_purchase'}"><a ui-sref="buyerSeekPurchase">采购询价</a></li>
                 <!--<li ng-class="{'active' : active == 'purc_haseinquiry'}"><a ui-sref="purc_haseinquiry">定向询价</a></li>-->
                 <li ng-class="{'active' : active == 'buyer_cart'}"><a  ui-sref="buyer_cart">购物车<em>(<span ng-bind="countCart || 0 | number"></span>)</em></a> </li>
-                <li ng-class="{'active' : active == 'buyer_order'}"><a  ui-sref="buyer_order">采购订单</a></li>
-                <li ng-class="{'active' : active == 'buyer_pay_center'}"><a  ui-sref="pay_center">应付对账</a></li>
+                <li ng-class="{'active' : active == 'buyer_order'}"><a  ui-sref="purc_usercenter_order">采购订单</a></li>
+                <li ng-class="{'active' : active == 'buyer_pay_center'}"><a  ui-sref="fa_arCheck">应付对账</a></li>
                 <li ng-class="{'active' : active == 'buyer_invoice'}"><a  ui-sref="buyer_no_invoice">发票管理</a></li>
                 <li ng-class="{'active' : active == 'buyer_tender'}"><a  ui-sref="purc_tenderlist">采购招标</a></li>
                 <li ng-class="{active: active == 'purc_vendor'}"><a ui-sref="purc_vendor">供应商资料</a></li>

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

@@ -45,13 +45,13 @@
 	<ul>
 		<div>
 			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><span ui-sref="vendorSeekPurchase">商机管理</span></li>
-			<li ng-class="{'active' : active == 'vendor_order'}"><span  ui-sref="vendor_order">销售订单</span></li>
+			<li ng-class="{'active' : active == 'vendor_order'}"><span  ui-sref="saleOrder">销售订单</span></li>
 			<li ng-class="{'active' : active == 'vendor_logistics'}">
 				<span  ui-sref="vendor_logistics" ng-hide="store && (!store.status || store.status === 'OPENED')">物流管理</span>
 				<span  ui-sref="vendor_deliveryRule" ng-if="store && (!store.status || store.status === 'OPENED')">物流管理</span>
 			</li>
 			<li ng-class="{'active' : active == 'vendor_invoice'}"><span  ui-sref="vendorInvoice">开票管理</span></li>
-			<li ng-class="{'active' : active == 'vendor_pay_center'}"><span  ui-sref="pay_center">应收对账</span></li>
+			<li ng-class="{'active' : active == 'vendor_pay_center'}"><span  ui-sref="fa_apCheck">应收对账</span></li>
 			<li ng-class="{'active' : active == 'vendor_store'}">
 				<!-- 我要开店 !store && applyStatus == 'NONE' -->
 				<span  ui-sref="vendor_store_apply" ng-if="!store && applyStatus == 'NONE'">开店申请</span>