Browse Source

Merge branch 'vendor_logistics_v2' into function_vendor_modify

# Conflicts:
#	src/main/java/com/uas/platform/b2c/logistics/dao/DistributionRuleDao.java
#	src/main/java/com/uas/platform/b2c/logistics/service/impl/DistributionRuleServiceImpl.java
#	src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_ctrl.js
hulh 8 years ago
parent
commit
f93d5add68

+ 47 - 3
src/main/java/com/uas/platform/b2c/logistics/controller/DistributionRuleController.java

@@ -1,9 +1,11 @@
 package com.uas.platform.b2c.logistics.controller;
 
+import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.logistics.model.DistributionRule;
 import com.uas.platform.b2c.logistics.service.DistributionRuleService;
 import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.PageParams;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -21,6 +23,8 @@ public class DistributionRuleController {
 	@Autowired
 	private DistributionRuleService distributionRuleService;
 
+	private static final UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
+
 	/**
 	 * 分页获取配送规则
 	 * @param params
@@ -45,16 +49,26 @@ public class DistributionRuleController {
 	 * 保存配送规则
 	 * @param isActive
 	 * @param json
-	 * @param isAdd true-新增,false-另存
+	 * @param isAdd true-保存,false-另存
 	 * @return
 	 */
 	@RequestMapping(value = "/save", method = RequestMethod.POST)
-	public DistributionRule saveRule(Boolean isAdd, Boolean isActive, @RequestBody String json){
-		System.out.println(json + "=" + isActive + "=" + isAdd);
+	public ResultMap saveRule(@RequestParam("isAdd") Boolean isAdd, @RequestParam("isActive") Boolean isActive, @RequestBody String json){
 		DistributionRule rule = FastjsonUtils.fromJson(json, DistributionRule.class);
 		return distributionRuleService.saveDistributionRule(isAdd, isActive, rule);
 	}
 
+	/**
+	 * 根据id修改配送规则的生效状态
+	 * @param id
+	 * @param isActive
+	 * @return
+	 */
+	@RequestMapping(value = "/status", method = RequestMethod.POST)
+	public ResultMap changeActive(@RequestParam("id") Long id, @RequestParam("isActive") Boolean isActive){
+		return distributionRuleService.changeRuleActive(id, isActive);
+	}
+
 	/**
 	 * 返回所有的配送规则名称
 	 * @return
@@ -72,4 +86,34 @@ public class DistributionRuleController {
 	public ResultMap findRuleCount(){
 		return distributionRuleService.findCountRule();
 	}
+
+	/**
+	 * 查找配送规则名是否存在
+	 * @param id
+	 * @param ruleName
+	 * @param newSave 是否为另存为
+	 * @return
+	 */
+	@RequestMapping(value = "/checkName", method = RequestMethod.GET)
+	public ResultMap checkRuleName(@RequestParam(value = "id", required = false) Long id, @RequestParam(value = "ruleName") String ruleName, @RequestParam(value = "newSave") Boolean newSave){
+		return distributionRuleService.containsName(id, ruleName, newSave);
+	}
+
+	/**
+	 * 根据配送方式和地址信息匹配适用的配送规则
+	 * @param method 配送方式
+	 * @param area 地址信息
+	 * @return
+	 */
+	@RequestMapping(value = "/rule/matchArea", method = RequestMethod.GET)
+	public List<DistributionRule> ruleOfMatchArea(Integer method, String area, String uuid){
+		assert logger != null;
+		logger.log("匹配配送规则", "订单的配送方式为" + method + ", 地区为 : " + area);
+		return distributionRuleService.ruleMatchArea(method, area, uuid);
+	}
+
+	@RequestMapping
+	public DistributionRule getMinRule(){
+		return null;
+	}
 }

+ 11 - 3
src/main/java/com/uas/platform/b2c/logistics/dao/DistributionRuleDao.java

@@ -50,11 +50,19 @@ public interface DistributionRuleDao extends JpaSpecificationExecutor<Distributi
 	List<String> findAllRuleNameByEnuu(@Param("enuu") Long enuu);
 
 	/**
-	 * 根据enuu和配送方式获取配送规则列表
-	 *
+	 * 根据enuu和ruleName查找记录数
+	 * @param enuu
+	 * @param ruleName
+	 * @return
+	 */
+	@Query(value = "select count(1) from DistributionRule d where d.enuu = :enuu and d.ruleName = :ruleName")
+	int findCountRuleName(@Param("enuu") Long enuu, @Param("ruleName") String ruleName);
+
+	/**
+	 * 根据配送方式和enuu获取生效的配送规则列表
 	 * @param enuu
 	 * @param shippingMethod
 	 * @return
 	 */
-	List<DistributionRule> findByEnuuAndShippingMethod(Long enuu, Integer shippingMethod);
+	List<DistributionRule> findByEnuuAndShippingMethodAndActive(Long enuu, Integer shippingMethod, Short active);
 }

+ 4 - 4
src/main/java/com/uas/platform/b2c/logistics/model/DistributionRule.java

@@ -45,10 +45,10 @@ public class DistributionRule {
 	private String ruleName;
 
 	/**
-	 * 适用店铺 1101-自营,1102-寄售
+	 * 适用店铺 0-自营,1-寄售
 	 */
 	@Column(name = "rule_store_type")
-	private Integer storeType;
+	private Short storeType;
 
 	/**
 	 * 适用类型 1201-普通订单,1202-预售订单,1203-发票
@@ -152,11 +152,11 @@ public class DistributionRule {
 		this.enuu = enuu;
 	}
 
-	public Integer getStoreType() {
+	public Short getStoreType() {
 		return storeType;
 	}
 
-	public void setStoreType(Integer storeType) {
+	public void setStoreType(Short storeType) {
 		this.storeType = storeType;
 	}
 

+ 2 - 2
src/main/java/com/uas/platform/b2c/logistics/model/RuleQtyFare.java

@@ -6,11 +6,11 @@ package com.uas.platform.b2c.logistics.model;
  */
 public class RuleQtyFare {
 	/**
-	 * 分段开始
+	 * 分段开始  --包括开始
 	 */
 	private Double start;
 	/**
-	 * 分段结束
+	 * 分段结束  --不包括结束
 	 */
 	private Double end;
 	/**

+ 29 - 1
src/main/java/com/uas/platform/b2c/logistics/service/DistributionRuleService.java

@@ -27,7 +27,15 @@ public interface DistributionRuleService {
 	 * @param rule
 	 * @return
 	 */
-	DistributionRule saveDistributionRule(Boolean isAdd, Boolean isActive, DistributionRule rule);
+	ResultMap saveDistributionRule(Boolean isAdd, Boolean isActive, DistributionRule rule);
+
+	/**
+	 * 根据id修改配送规则的生效状态
+	 * @param id
+	 * @param isActive
+	 * @return
+	 */
+	ResultMap changeRuleActive(Long id, Boolean isActive);
 
 	/**
 	 * 根据id删除指定配送规则
@@ -41,6 +49,26 @@ public interface DistributionRuleService {
 	 */
 	List<String> findAllRuleName();
 
+	/**
+	 * 返回当前enuu下配送规则总数
+	 * @return
+	 */
 	ResultMap findCountRule();
 
+	/**
+	 * 查找是否已存在该名称
+	 * @param id
+	 * @param ruleName
+	 * @param newSave
+	 * @return
+	 */
+	ResultMap containsName(Long id, String ruleName, Boolean newSave);
+
+	/**
+	 * 根据配送方式和地区匹配适用的配送规则
+	 * @param method
+	 * @param area
+	 * @return
+	 */
+	List<DistributionRule> ruleMatchArea(Integer method, String area, String uuid);
 }

+ 99 - 17
src/main/java/com/uas/platform/b2c/logistics/service/impl/DistributionRuleServiceImpl.java

@@ -1,14 +1,21 @@
 package com.uas.platform.b2c.logistics.service.impl;
 
+import com.uas.platform.b2c.core.config.SysConf;
+import com.uas.platform.b2c.core.constant.ShortConstant;
 import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.logistics.dao.DistributionRuleDao;
 import com.uas.platform.b2c.logistics.model.DistributionRule;
 import com.uas.platform.b2c.logistics.model.RuleQtyArea;
 import com.uas.platform.b2c.logistics.service.DistributionRuleService;
+import com.uas.platform.b2c.prod.store.dao.StoreInDao;
+import com.uas.platform.b2c.prod.store.model.StoreIn;
+import com.uas.platform.b2c.trade.support.CodeType;
 import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageParams;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.jpa.domain.Specification;
@@ -34,6 +41,12 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 	@Autowired
 	private DistributionRuleDao distributionRuleDao;
 
+	@Autowired
+	private StoreInDao storeInDao;
+
+	@Autowired
+	private SysConf sysConf;
+
 	@Override
 	public Page<DistributionRule> findPageRule(PageParams params) {
 		final PageInfo pageInfo = new PageInfo(params);
@@ -48,21 +61,35 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 	}
 
 	@Override
-	public DistributionRule saveDistributionRule(Boolean isAdd, Boolean isActive, DistributionRule rule) {
+	public ResultMap saveDistributionRule(Boolean isAdd, Boolean isActive, DistributionRule rule) {
+		if (rule.getShippingMethod() == null){
+			return new ResultMap(CodeType.NO_INFO, "请选择配送方式");
+		}
+		if (rule.getRuleName() == null || rule.getRuleName().isEmpty()){
+			return new ResultMap(CodeType.NO_INFO, "请填写规则名称");
+		}
+		if (CollectionUtils.isEmpty(rule.getAreas())){
+			return new ResultMap(CodeType.NO_INFO, "您还没有选择任何地区");
+		}
+		if (rule.getFareType() == 2 && CollectionUtils.isEmpty(rule.getFares())){
+			return new ResultMap(CodeType.NO_INFO, "请完善计费方式");
+		}
 		if (rule.getId() == null){
 			Long uu = SystemSession.getUser().getUserUU();
 			Long enuu = SystemSession.getUser().getEnterprise().getUu();
 			rule.setUseruu(uu);
 			rule.setEnuu(enuu);
-			/**
-			 * TODO 默认为自营的,后期再加入判断
-			 */
-			rule.setStoreType(1101);
+
+			if (enuu.longValue() == sysConf.getEnUU().longValue()){
+				rule.setStoreType(ShortConstant.YES_SHORT);
+			}else {
+				rule.setStoreType(ShortConstant.NO_SHORT);
+			}
 		}
 		if (isActive){
-			rule.setActive((short)1);
+			rule.setActive(ShortConstant.YES_SHORT);
 		}else {
-			rule.setActive((short)0);
+			rule.setActive(ShortConstant.NO_SHORT);
 		}
 		if (!isAdd){
 			if (rule.getId() != null){
@@ -70,10 +97,7 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 			}
 		}
 		int count = distributionRuleDao.findCountByEnuu(rule.getEnuu());
-		System.out.println(rule.getNum());
-		System.out.println("count=" + count);
 		int num = count == 0 ? 1 : ++count;
-		System.out.println(num);
 		if (rule.getId() == null){
 			if (rule.getNum() == null){
 				rule.setNum(num);
@@ -97,7 +121,20 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 				}
 			}
 		}
-		return distributionRuleDao.save(rule);
+		distributionRuleDao.save(rule);
+		return ResultMap.success(null);
+	}
+
+	@Override
+	public ResultMap changeRuleActive(Long id, Boolean isActive) {
+		DistributionRule rule = distributionRuleDao.findOne(id);
+		if (isActive){
+			rule.setActive((short)1);
+		}else {
+			rule.setActive((short)0);
+		}
+		distributionRuleDao.save(rule);
+		return ResultMap.success(null);
 	}
 
 	public void sortRule(Long id, int num){
@@ -108,7 +145,7 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 			if (rule.getId() != id){
 				if (start == num){
 					start++;
-					System.out.println("start=" + start);
+//					System.out.println("start=" + start);
 				}
 				rule.setNum(start++);
 			}
@@ -117,7 +154,7 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 	}
 
 	public void sortRule(int num){
-		System.out.println("num=" + num);
+//		System.out.println("num=" + num);
 		Long enuu = SystemSession.getUser().getEnterprise().getUu();
 		List<DistributionRule> ruleList = distributionRuleDao.findAllByEnuu(enuu);
 		int start = 1;
@@ -157,12 +194,54 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 		return ResultMap.success(count);
 	}
 
-//	@Override
-	public List<DistributionRule> ruleMatchArea(Integer method, String area) {
+	@Override
+	public ResultMap containsName(Long id, String ruleName, Boolean newSave) {
 		Long enuu = SystemSession.getUser().getEnterprise().getUu();
+		Boolean repeat = null;
+//		System.out.println("id=" + id);
+		if (id != null){
+			//修改配送规则情况,分保存和另存为两种
+			if (newSave){ //另存为
+				int count = distributionRuleDao.findCountRuleName(enuu, ruleName);
+//				System.out.println("count=" + count);
+				if (count != 0){
+					repeat = true;
+				}else {
+					repeat = false;
+				}
+			}else { //保存
+				DistributionRule rule = distributionRuleDao.findOne(id);
+				if (ruleName.equals(rule.getRuleName())){
+					repeat = false;
+				}else {
+					int count = distributionRuleDao.findCountRuleName(enuu, ruleName);
+//					System.out.println("count=" + count);
+					if (count != 0){
+						repeat = true;
+					}else {
+						repeat = false;
+					}
+				}
+			}
+		}else { //新增配送规则情况
+			int count = distributionRuleDao.findCountRuleName(enuu, ruleName);
+//			System.out.println("count=" + count);
+			if (count != 0){
+				repeat = true;
+			}else {
+				repeat = false;
+			}
+		}
+		return ResultMap.success(repeat);
+	}
+
+	@Override
+	public List<DistributionRule> ruleMatchArea(Integer method, String area, String uuid) {
+		StoreIn store = storeInDao.findByUuid(uuid);
+
 		List<DistributionRule> resultList = new ArrayList<>();
 		// 根据配送方式找出所有的配送规则
-		List<DistributionRule> methodList = distributionRuleDao.findByEnuuAndShippingMethod(enuu, method);
+		List<DistributionRule> methodList = distributionRuleDao.findByEnuuAndShippingMethodAndActive(store.getEnUU(), method, ShortConstant.YES_SHORT);
 
 		for (DistributionRule rule : methodList){
 			List<RuleQtyArea> qtyArea = rule.getAreas();
@@ -182,8 +261,11 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 	 * @return
 	 */
 	public Map<String, Map<String, List<String>>> convertArea(List<RuleQtyArea> qtyArea){
-		Map<String, Map<String, List<String>>> areaMap = new HashMap<>();
+		if (qtyArea == null) {
+			throw new IllegalOperatorException("地区信息丢失,请刷新后重试");
+		}
 
+		Map<String, Map<String, List<String>>> areaMap = new HashMap<>();
 		for (RuleQtyArea a : qtyArea){
 			if (a.getProvince() != null && a.getProvince().length() != 0){
 				//判断该RuleQtyArea是否包含省字段

+ 13 - 0
src/main/webapp/resources/js/common/query/logisticsPort.js

@@ -96,9 +96,22 @@ define([ 'ngResource' ], function() {
 				method: 'GET',
 				isArray : true
 			},
+			changeActive : {
+				url: 'trade/distributionRule/status',
+				method: 'POST'
+			},
 			findCountOfRule : {
 				url: 'trade/distributionRule/count',
 				method: 'GET'
+			},
+			checkRuleName : {
+				url: 'trade/distributionRule/checkName',
+				method: 'GET'
+			},
+			findMatchRule : {
+				url: 'trade/distributionRule/rule/matchArea',
+				method: 'GET',
+				isArray : true
 			}
 		})
 	}]);

+ 9 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -3,7 +3,7 @@
  *  订单付款的界面
  */
 define(['app/app'], function(app) {
-	app.register.controller('orderPayCtrl', ['$scope', '$rootScope', '$stateParams', '$modal', '$state', 'Bill', 'toaster', 'Order', '$filter', 'ShippingAddress', 'Ysepay', '$q', 'NumberService', 'Cart', '$timeout', function($scope, $rootScope, $stateParams, $modal, $state, Bill, toaster, Order, $filter, ShippingAddress, Ysepay, $q, NumberService, Cart, $timeout) {
+	app.register.controller('orderPayCtrl', ['$scope', '$rootScope', '$stateParams', '$modal', '$state', 'Bill', 'toaster', 'Order', '$filter', 'ShippingAddress', 'Ysepay', '$q', 'NumberService', 'Cart', '$timeout', 'DistributionRule', function($scope, $rootScope, $stateParams, $modal, $state, Bill, toaster, Order, $filter, ShippingAddress, Ysepay, $q, NumberService, Cart, $timeout, DistributionRule) {
 
 		$rootScope.active = 'buyer_cart';
 
@@ -336,6 +336,14 @@ define(['app/app'], function(app) {
 			});
 		};
 
+		$scope.getRule = function (uuid) {
+			DistributionRule.findMatchRule({method:1301, area:$scope.payment.address.area, uuid:uuid},{},function (data) {
+				if (data){
+					console.log(data);
+				}
+			})
+		};
+
 		// 产生要提交的单个订单数据
 		var generateOrderInfo = function() {
 			/*订单信息:orderInfo含有信息:id、orderid、deliverytype、add_id、invoicetype、invoiceid、paytype、totalprice(price)、

+ 1 - 34
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_ctrl.js

@@ -178,6 +178,7 @@ define([ 'app/app' ], function(app) {
 
         $scope.repeatError = false;
         $scope.checkRuleName = function () {
+            console.log($scope.nameArray);
             var k = 1;
             angular.forEach($scope.nameArray, function (item) {
                 if (item == $scope.modifyRule.ruleName){
@@ -316,17 +317,9 @@ define([ 'app/app' ], function(app) {
             $scope.fareArray[index+1].start = Number(data.end);
         };
 
-        /**
-         * isAdd false-另存为,true-保存
-         * @param isAdd
-         */
         $scope.saveDistributionRule = function (isAdd) {
             if (!isAdd){
                 $scope.checkRuleName();
-            }
-            console.log($scope.modifyRule.id);
-            if ($scope.modifyRule.id){
-
             }
             if (!$scope.modifyRule.shippingMethod){
                 toaster.pop('error', "请选择配送方式");
@@ -361,10 +354,6 @@ define([ 'app/app' ], function(app) {
                 toaster.pop('error', "您还没有选择任何地区");
                 return;
             }
-            if (!$scope.modifyRule.qtyArea){
-                toaster.pop('error', "您还没有选择任何地区");
-                return;
-            }
             if ($scope.modifyRule.fareType == 1){
                 if (!$scope.modifyRule.uniformPrice){
                     toaster.pop('error', "请输入统一规定运费");
@@ -587,28 +576,6 @@ define([ 'app/app' ], function(app) {
             var me = this;
             me.$data = tree;
 
-            /**
-             * 初始化树,勾选已有的数据
-             * @param initData
-             */
-            me.newInitData = function (initData) {
-                //initData,这时只有省,市,区的数据
-                if(initData){
-                    angular.forEach(initData, function (v) {
-                        var p = {};
-                        for(var i in me.$data) {
-                            var m = me.$data[i];
-                           for(var i in m.items){
-                               var value = m.items[i];
-                               if (value.label == v.province){
-                                   p = value; break;
-                               }
-                           }
-                        }
-                    })
-                }
-            };
-
             me.initData = function (initData) {
                 console.log(initData);
                 if(initData) {

+ 13 - 6
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_distributor_ctrl.js

@@ -156,12 +156,12 @@ define([ 'app/app' ], function(app) {
                     break;
                 }
             }
-            var addrPatt = new RegExp("^[A-Za-z0-9\u4e00-\u9fa5]+$");
-            if (!addrPatt.test($scope.keyword) && $scope.keyword.length > 0){
-                $scope.companyError = true;
-            }else {
-                $scope.companyError = false;
-            }
+            // var addrPatt = new RegExp("^[A-Za-z0-9\u4e00-\u9fa5]+$");
+            // if (!addrPatt.test($scope.keyword) && $scope.keyword.length > 0){
+            //     $scope.companyError = true;
+            // }else {
+            //     $scope.companyError = false;
+            // }
             initIndex();
             $scope.showDownFrame = true;
             matchArray();
@@ -305,6 +305,13 @@ define([ 'app/app' ], function(app) {
             $scope.keyword = "";
         };
 
+        $scope.removeDistributor = function (data, index) {
+            $scope.chooseList.splice(index, 1);
+            if (data.code){
+                $scope.selectFlag[data.code].isChoosed = !$scope.selectFlag[data.code].isChoosed;
+            }
+        };
+
         $scope.ChooseDistributor = function (data) {
             if ($scope.selectFlag[data.code].isChoosed){
                 if ($scope.chooseList){

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

@@ -638,6 +638,7 @@
 								</select>
 								<em ng-if="order.status != 501" class="color333" ng-bind="deliveryMethod[order.deliverytype]">物流配送</em>
 								<!--<i>满1000元包邮,未满足的订单收取运费20元</i>-->
+								<!--<button ng-click="getRule(order.storeid)">获取配送规则</button>-->
 							</span>
 							<span class="total-price">
 								<p><strong>运费:</strong><em ng-bind="0 | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em></p>

+ 127 - 83
src/main/webapp/resources/view/vendor/forstore/vendor_delivery_rule.html

@@ -255,10 +255,10 @@
 						<td ng-bind="rule.ruleName">深圳市内满100元包邮,不满1000元邮费20元不满1000元</td>
 						<td>
 							<p class="switch">
-								<span class="checkbox" ng-click="changeActive(rule, true, true)" ng-if="rule.active == 0">
+								<span class="checkbox" ng-click="changeActive(rule.id, true)" ng-if="rule.active == 0">
 									<span><em></em></span>
 								</span>
-								<span class="checkbox active" ng-click="changeActive(rule, true, false)" ng-if="rule.active == 1">
+								<span class="checkbox active" ng-click="changeActive(rule.id, false)" ng-if="rule.active == 1">
 										<span><em></em></span>
 								</span>
 							</p>
@@ -298,7 +298,7 @@
 					<span style="width: 70px;">优先级排序</span>
 					<input type="text" class="form-control sort" ng-model="modifyRule.num" ng-blur="inputNum(modifyRule)">
 					<span><strong>*</strong>规则名称</span>
-					<input type="text" class="form-control rule" style="text-align: left;" ng-blur="checkRuleName()" ng-model="modifyRule.ruleName" placeholder="会在购物车中显示">
+					<input type="text" class="form-control rule" style="text-align: left;" ng-blur="checkRuleNameSize()" ng-model="modifyRule.ruleName" placeholder="会在购物车中显示">
 				</div>
 				<div class="row radio-1">
 					<span>是否生效</span>
@@ -319,36 +319,36 @@
 			<div class="rule-content">
 				<!--暂时注释,在以后的开发中在释放出来-->
 				<!--<div class="row check-1">-->
-					<!--<span><strong>*</strong>适用类型</span>-->
-					<!--<label class="check-act">-->
-						<!--<input type="checkbox" id="1" ng-model="orderType.normal"/>-->
-						<!--<label for="1"></label>-->
-						<!--普通订单-->
-					<!--</label>-->
-					<!--<label class="check-act">-->
-						<!--<input type="checkbox" id="2" ng-model="orderType.preSale"/>-->
-						<!--<label for="2"></label>-->
-						<!--预售订单-->
-					<!--</label>-->
-					<!--<label class="check-act">-->
-						<!--<input type="checkbox" id="3" ng-modle="orderType.bill"/>-->
-						<!--<label for="3"></label>-->
-						<!--发票-->
-					<!--</label>-->
-					<!--<span>适用用户</span>-->
-					<!--<select class="select-adder form-control for-people" ng-model="modifyRule.userType">-->
-						<!--<option value="1301">所有用户</option>-->
-					<!--</select>-->
+				<!--<span><strong>*</strong>适用类型</span>-->
+				<!--<label class="check-act">-->
+				<!--<input type="checkbox" id="1" ng-model="orderType.normal"/>-->
+				<!--<label for="1"></label>-->
+				<!--普通订单-->
+				<!--</label>-->
+				<!--<label class="check-act">-->
+				<!--<input type="checkbox" id="2" ng-model="orderType.preSale"/>-->
+				<!--<label for="2"></label>-->
+				<!--预售订单-->
+				<!--</label>-->
+				<!--<label class="check-act">-->
+				<!--<input type="checkbox" id="3" ng-modle="orderType.bill"/>-->
+				<!--<label for="3"></label>-->
+				<!--发票-->
+				<!--</label>-->
+				<!--<span>适用用户</span>-->
+				<!--<select class="select-adder form-control for-people" ng-model="modifyRule.userType">-->
+				<!--<option value="1301">所有用户</option>-->
+				<!--</select>-->
 				<!--</div>-->
 				<div class="row" style="position: relative;">
 					<span><strong>*</strong>适用地区</span>
 					<div class="area-content" ng-if="mapArray.length >0">
-						<span ng-repeat="data in mapArray" ng-click="deleteMapItem($index)">
-							<em ng-if="!data.province">{{data.mainland}}</em>
+						<span ng-repeat="data in mapArray">
+							<em ng-if="data.mainland">{{data.mainland}}</em>
 							<em ng-if="data.province">{{data.province}}</em>
 							<em ng-if="data.city">/{{data.city}}</em>
 							<em ng-if="data.area">/{{data.area}}</em>
-							<i class="fa fa-minus-circle"></i>
+							<i class="fa fa-minus-circle" ng-click="deleteMapItem($index)"></i>
 						</span>
 					</div>
 					<button ng-click="chooseAddress()">选择地区</button>
@@ -439,11 +439,10 @@
 				</div>
 				<!--统一规定运费-->
 				<div class="style-regulations common-style" ng-if="modifyRule.fareType==1">
-					<div class="row dot">
+					<div class="row dot" style="padding-bottom: 10px;">
 						<span>统一运费</span>
 						<div class="price-input">
-							<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-							<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>
+							<i class="currency" ng-bind="currencySymbol"></i>
 							<input type="text" class="form-control" placeholder="请输入运费" ng-blur="inputUniform()" ng-model="modifyRule.uniformPrice" />
 						</div>
 					</div>
@@ -451,45 +450,63 @@
 						<span class="f14" style="margin-right: 10px;">计算说明</span>
 						<!--&lt;!&ndash;可编辑&ndash;&gt;-->
 						<!--<div class="edit" style="margin-top: 6px;">-->
-							<!--<textarea class="form-control" placeholder="全国统一运费 $20"></textarea>-->
-							<!--<div class="prompt"><strong>*</strong>公式说明内容将会在购物车中显示,可自行修改</div>-->
+						<!--<textarea class="form-control" placeholder="全国统一运费 $20"></textarea>-->
+						<!--<div class="prompt"><strong>*</strong>公式说明内容将会在购物车中显示,可自行修改</div>-->
 						<!--</div>-->
 						<!--不可以编辑的状态-->
-						<div class="no-edit" style="margin-top: 6px;">全国统一运费
-							<em ng-if="modifyRule.currencyName=='RMB'">¥</em>
-							<em ng-if="modifyRule.currencyName=='USD'">$</em>
-							{{modifyRule.uniformPrice}}
+						<div class="no-edit" style="margin-top: 6px; position: relative;">适用范围内统一运费
+							<em ng-bind="currencySymbol"></em>
+							<div ng-bind="modifyRule.uniformPrice" style="width: 80px;overflow: hidden;float: left;
+    position: absolute;top: 0;left: 133px;"></div>
 						</div>
 					</div>
 				</div>
+				<style>
+					.rule-main .rule-content .common-style .hr01{
+						float: left;
+						width: 14px;
+						text-align: center;
+						color: #666;
+					}
+					.rule-main .rule-content .common-style .price-input input.none{
+						background: #dad8d8;
+					}
+					.rule-main .rule-content .common-style .price-input input.none:hover{
+						cursor: not-allowed;
+					}
+					.add-box{
+						margin-right: 412px;
+						float: right;
+					}
+				</style>
 				<!--按总金额计算-->
 				<div class="style-price common-style" ng-if="modifyRule.fareType==2">
-					<div class="row" ng-repeat="data in fareArray" ng-class="{'dot' : $index==0}">
-						<span>总金额在</span>
+					<div class="row" ng-repeat="data in fareArray" ng-class="{'dot' : $index==0,'active': $index == fareArray.length - 1}">
+						<span style="margin-right: 7px;">总金额在</span>
 						<div class="price-input" ng-if="$index == 0">
-							<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-							<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>
-							<input type="text" class="form-control" placeholder="请输入金额" ng-blur="inputQtyFare(data, $index)" ng-model="data.end" />
-							以下,
+							<i class="currency" ng-bind="currencySymbol"></i>
+							<span ng-bind="data.start"></span>
+							<!--<input type="text" class="form-control none" ng-model="data.start" disabled/>-->
 						</div>
 						<div class="price-input" ng-if="$index != 0 && $index != fareArray.length - 1">
-							<em>
-								<i ng-bind="modifyRule.currencyName=='RMB' ? '¥' : '$'"></i><i ng-if="fareArray[$index-1].end">{{fareArray[$index-1].end}}</i>以上,
-							</em>
-							<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-							<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>
+							<i class="currency" ng-bind="currencySymbol"></i>
+							<span ng-bind="fareArray[$index-1].end"></span>
+							<!--<input type="text" class="form-control none" ng-model="data.start" disabled/>-->
+						</div>
+						<div class="hr01" ng-if="$index != fareArray.length - 1">&#150;</div>
+						<div class="price-input" ng-if="$index != fareArray.length - 1">
+							<i class="currency" ng-bind="currencySymbol"></i>
 							<input type="text" class="form-control" placeholder="请输入金额" ng-blur="inputQtyFare(data, $index)" ng-model="data.end" />
-							<em>以下,</em>
 						</div>
 						<div class="price-input" ng-if="$index == fareArray.length - 1">
-							<em>
-								<i ng-bind="modifyRule.currencyName=='RMB' ? '¥' : '$'"></i><i ng-if="fareArray[$index-1].end">{{fareArray[$index-1].end}}</i>以上,
-							</em>
+							<i class="currency" ng-bind="currencySymbol"></i>
+							<span ng-bind="fareArray[$index-1].end"></span>
+							<!--<input type="text" class="form-control none" ng-model="fareArray[$index-1].end" disabled/>-->
+							&nbsp;&nbsp;&nbsp;以上
 						</div>
 						<div class="price-input">
-							<em>运费为</em>
-							<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-							<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>
+							<em>,运费为</em>
+							<i class="currency" ng-bind="currencySymbol"></i>
 							<input type="text" class="form-control" placeholder="请输入运费" ng-blur="inputFare(data)" ng-model="data.fare" />
 						</div>
 						<div class="add-box">
@@ -515,35 +532,31 @@
 						<div class="no-edit" style="margin-top: 6px;">
 							<div ng-repeat="data in fareArray">
 								<p ng-if="$index == 0">
-									总
-									<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.end}}以下
+									总金额
+									<i class="currency" ng-bind="currencySymbol">¥</i><i class="input-text" ng-bind="data.start"></i>
+									-&nbsp;<i class="input-text" ng-bind="data.end"></i>&nbsp;
 									运费为
-									<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.fare}}
+									<i class="currency" ng-bind="currencySymbol">¥</i>
+									<i class="input-text" ng-bind="data.fare"></i>
 								</p>
 								<p ng-if="$index != 0 && $index != fareArray.length - 1">
-									总价在
-									<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.start}}以上(含
-									<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.start}}
-									),
-									<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.end}}以下,
+									总金额在
+									<i class="currency" ng-bind="currencySymbol">¥</i>
+									<i class="input-text" ng-bind="data.start"></i>
+									-&nbsp;<i class="input-text" ng-bind="data.end"></i>(含
+									<i class="currency" ng-bind="currencySymbol">¥</i>{{data.start}}),
 									运费为
-									<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.fare}}
+									<i class="currency" ng-bind="currencySymbol">¥</i>
+									<i class="input-text" ng-bind="data.fare"></i>
 								</p>
 								<p ng-if="$index == fareArray.length-1">
-									总价在
-									<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.start}}以上(含
-									<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.start}}
-									),运费为
-									<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
-									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.fare}}
+									总金额在
+									<i class="currency" ng-bind="currencySymbol">¥</i>
+									<i class="input-text">{{data.start}}</i>(含
+									<i class="currency" ng-bind="currencySymbol">¥</i>
+									{{data.start}})以上,运费为
+									<i class="currency" ng-bind="currencySymbol">¥</i>
+									<i class="input-text" ng-bind="data.fare"></i>
 								</p>
 							</div>
 						</div>
@@ -741,11 +754,15 @@
 		margin-right: 0 auto;
 	}
 	.rule-main .rule-content .common-style .row{
-		padding: 8px;
+		padding: 0 8px;
+		padding-top: 10px;
 		background: #e8e7e7;
-		min-height: 40px;
+		/*min-height: 40px;*/
 		font-size: 12px;
 	}
+	.rule-main .rule-content .common-style .row.active{
+		padding-bottom: 10px;
+	}
 	.rule-main .rule-content .common-style .row span{
 		font-size: 12px;
 	}
@@ -755,12 +772,37 @@
 		position: relative;
 		z-index: 10;
 	}
+	.rule-main .rule-content .common-style .price-input span{
+		border-radius: 0;
+		height: 26px;
+		line-height: 26px;
+		border: #d4d4d4 1px solid;
+		background: #dad8d8;
+		display: inline-block;
+		width: 80px;
+		text-align: center;
+		overflow: hidden;
+		margin-right: 0;
+	}
 	.rule-main .rule-content .common-style .price-input em{
 		float: left;
-		margin: 0 5px;
+		margin: 0 7px 0 0;
 	}
 	.rule-main .rule-content .common-style .price-input em i{
 		margin-right: 20px;
+		display: inline-block;
+		max-width: 60px;
+		float: left;
+		overflow: hidden;
+	}
+	.rule-main .rule-content .common-style.style-price .row .no-edit p i.input-text{
+		display: inline-block;
+		max-width: 60px;
+		height: 15px;
+		overflow: hidden;
+		position: relative;
+		top: 1px;
+		margin-right: 5px;
 	}
 	.rule-main .rule-content .common-style .price-input i.currency{
 		width: 20px;
@@ -770,13 +812,14 @@
 		background: #b0b0b0;
 		color: #fff;
 		float: left;
-		border-bottom-left-radius: 3px;
-		border-top-left-radius: 3px;
+		margin-right: -1px;
+		/*border-bottom-left-radius: 3px;*/
+		/*border-top-left-radius: 3px;*/
 	}
 	.rule-main .rule-content .common-style .price-input input{
 		max-width: 80px;
 		padding: 0;
-		margin-right: 3px !important;
+		margin-right: 0 !important;
 		position: relative;
 		/*left: -1px;*/
 		font-size: 12px;
@@ -904,7 +947,8 @@
 		padding: 8px 10px;
 	}
 	.rule-main .rule-content .common-style.style-price .row .no-edit p{
-		line-height: 25px;
+		line-height: 20px;
+		height: 20px;
 	}
 	.rule-main .rule-content .common-style .row{
 		position: relative;

+ 3 - 3
src/main/webapp/resources/view/vendor/modal/vendor_distributor_manage.html

@@ -371,9 +371,9 @@
     </div>
     <div class="dis-manage-middle">
         <input class="dis-manage-middle-input" type="text" placeholder="请输入配送商名称" ng-change="inputContent()" ng-model="keyword" ng-keydown="onKeyDown()" ng-blur="onBlur()" ng-focus="getFocus()">
-        <button ng-disabled="!keyword || keyword.length==0 || companyError" class="btn btn-success" ng-click="addItemInSelected()" type="button">新增</button>
-        <span class="dis-manage-middle-message" ng-if="!companyError && !containsItem && keyword.length > 0"><i class="fa fa-info-circle"></i>系统无法提供此物流信息,请根据物流单号到相应的官网查询</span>
-        <span class="dis-manage-middle-message" ng-if="companyError && keyword.length > 0">请输入正确的物流公司</span>
+        <button ng-disabled="!keyword || keyword.length==0" class="btn btn-success" ng-click="addItemInSelected()" type="button">新增</button>
+        <span class="dis-manage-middle-message" ng-if="!containsItem && keyword.length > 0"><i class="fa fa-info-circle"></i>系统无法提供此物流信息,请根据物流单号到相应的官网查询</span>
+        <!--<span class="dis-manage-middle-message" ng-if="companyError && keyword.length > 0">请输入正确的物流公司</span>-->
         <!--<ul id="ulContent">-->
         <!--<li ng-repeat="data in resultList" ng-click="clickItem(data)" ng-class="{'active': $index==selectIndex}">{{data.companyName}}</li>-->
         <!--</ul>-->