Просмотр исходного кода

配送规则和新增页面合并

hulh 8 лет назад
Родитель
Сommit
b7cf62e90e

+ 62 - 62
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_add_ctrl.js

@@ -278,10 +278,21 @@ define([ 'app/app' ], function(app) {
 
         $scope.chooseBox = false;
         $scope.cancel = function () {
-            $scope.cityData = convert($scope.cityJson);
-            // $scope.tree = new TreeData($scope.cityData);
+            $scope.resetData($scope.tree.$data);
+            $scope.tree.initData($scope.mapArray);
             $scope.chooseBox = false;
         };
+
+        $scope.resetData = function (items) {
+            angular.forEach(items, function (item) {
+                item.checked = false;
+                item.selectedNum = 0;
+                if (item.items){
+                    $scope.resetData(item.items);
+                }
+            });
+        };
+
         $scope.showSelectedData = function () {
             $scope.mapArray = [];
             $scope.mapArray = $scope.tree.getChecked();
@@ -289,6 +300,7 @@ define([ 'app/app' ], function(app) {
                 toaster.pop("info", "您还没有选择任何地区");
                 return;
             }
+            $scope.tree.initData($scope.mapArray);
             $scope.chooseBox = false;
         };
 
@@ -300,7 +312,9 @@ define([ 'app/app' ], function(app) {
             var k = false;
             for(const i in $scope.qtyAreaArray) {
                 var p = $scope.qtyAreaArray[i];
-                if (value == p) k = true; break;
+                if (value == p)  {
+                    k = true; break;
+                }
             }
             return k;
         };
@@ -333,40 +347,61 @@ define([ 'app/app' ], function(app) {
         // 选择地区
         $scope.chooseAddress = function () {
             $scope.chooseBox = true;
-            $scope.tree || ($scope.tree = new TreeData($scope.cityData));
+            $scope.tree = new TreeData($scope.cityData);
+            $scope.tree.initData($scope.mapArray);
         }
     }]);
     // 地区选择
     app.register.factory('TreeData', function(){
-        return function (tree, initData) {
+        return function (tree) {
             var me = this;
             me.$data = tree;
-            if(initData) {
-                angular.forEach(initData, function (v) {
-                    var p = {};
-                    for(var i in me.$data) {
-                        var value = me.$data[i];
-                        if(value.label == v.province) p = value; break;
-                    }
-                    p.checked = true;
-                    if(v.city) {
-                        p.semiChecked = true;
-                        var c = {};
-                        for(var i in p.items) {
+
+            me.initData = function (initData) {
+                if(initData) {
+                    angular.forEach(initData, function (v) {
+                        var p = {};
+                        for(var i in me.$data) {
                             var value = me.$data[i];
-                            if(value.label == v.city) v = value; break;
+                            if(value.label == v.province) {
+                                p = value; break;
+                            }
                         }
-                        c.checked = true;
-                        if(v.area) {
-                            c.semiChecked = true;
-                            for(var i in c.items) {
-                                var value = me.$data[i];
-                                if(value == v.area) value.checked = true; break;
+                        p.checked = true;
+                        if(v.city) {
+                            var c = {};
+                            for(var i in p.items) {
+                                var value = p.items[i];
+                                if(value.label == v.city) {
+                                    c = value; break;
+                                }
                             }
+                            c.checked = true;
+                            if(v.area) {
+                                for(var i in c.items) {
+                                    var value = c.items[i];
+                                    if(value.label == v.area) {
+                                        value.checked = true; break;
+                                    }
+                                }
+                            } else {
+                                angular.forEach(c.items, function (area) {
+                                    area.checked = true;
+                                })
+                            }
+                        } else {
+                            angular.forEach(p.items, function (city) {
+                                city.checked = true;
+                                angular.forEach(city.items, function (area) {
+                                    area.checked = true;
+                                })
+                            })
                         }
-                    }
-                })
-            }
+                    })
+                    me._updateParentsCheck(me.$data);
+                }
+            };
+
 
             /**
              * 折叠或展开文件夹
@@ -384,40 +419,6 @@ define([ 'app/app' ], function(app) {
                 return item;
             };
 
-            /**
-             * 初始化数据
-             */
-            me.initTreeData = function () {
-                // console.log("初始化进来了");
-                angular.forEach(me.$data, function (v) {
-                    if (v.checked){
-                        console.log(v.label);
-                        me._hasCheckedChildren(v);
-                        v.semiChecked = me._hasUncheckedChildren(v);
-                        if (!v.semiChecked || v.selectedNum == 0){
-                            me.check(v);
-                        }else {
-                            angular.forEach(v.items, function (k) {
-                                if (k.checked){
-                                    console.log(k.label);
-                                    me._hasCheckedChildren(k);
-                                    k.semiChecked = me._hasUncheckedChildren(k);
-                                    if (!k.semiChecked || k.selectedNum == 0){
-                                        me.check(k);
-                                    }else {
-                                        angular.forEach(k.items, function (m) {
-                                            if (m.checked){
-                                                me.check(m);
-                                            }
-                                        })
-                                    }
-                                }
-                            })
-                        }
-                    }
-                });
-            };
-
             /**
              * 折叠文件夹
              * @param item
@@ -451,7 +452,6 @@ define([ 'app/app' ], function(app) {
              */
             me._updateChildrenCheck = function (item) {
                 if(item.items) {
-                    // console.log(item.items.length);
                     item.selectedNum = item.checked ? item.items.length : 0;
                     angular.forEach(item.items, function (v) {
                         v.checked = item.checked;

+ 562 - 15
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_ctrl.js

@@ -1,6 +1,6 @@
 define([ 'app/app' ], function(app) {
     'use strict';
-    app.register.controller('vendorDeliveryRuleCtrl', ['$scope', '$rootScope', 'ngTableParams', 'DistributionRule', 'BaseService', 'toaster', '$state', function ($scope, $rootScope, ngTableParams, DistributionRule, BaseService, toaster, $state) {
+    app.register.controller('vendorDeliveryRuleCtrl', ['$scope', '$rootScope', 'ngTableParams', 'DistributionRule', 'BaseService', 'toaster', '$state', '$http', 'Enterprise', 'TreeData', function ($scope, $rootScope, ngTableParams, DistributionRule, BaseService, toaster, $state, $http, Enterprise, TreeData) {
         $rootScope.active = 'vendor_logistics';
         $scope.tab = 'deliverRule';
         $scope.title = '配送规则';
@@ -32,15 +32,354 @@ define([ 'app/app' ], function(app) {
             }
         });
 
+        /**
+         * 切换标题
+         */
+        $scope.toggleTab = function (tab) {
+            $scope.tab = tab;
+        };
+
+        /**
+         * 编辑或新增配送规则,初始化
+         * @param data
+         */
         $scope.editRule = function (data) {
+            $scope.editFrame = true;
+            $scope.tab = 'editRule';
             if (data){
-                $state.go('vendor_deliveryRule_add', {rule : angular.toJson(data)});
+                $scope.modifyRule = data;
+                $scope.isModify = true;
+                $scope.isActive = $scope.modifyRule.active == 1;
+                $scope.fareArray = angular.fromJson($scope.modifyRule.fares);
+                if ($scope.modifyRule.orderType){
+                    var orderTypeArray = $scope.modifyRule.orderType.split("-");
+                    $scope.orderType = {
+                        normal : false,
+                        preSale : false,
+                        bill : false
+                    };
+                    angular.forEach(orderTypeArray, function (data) {
+                        if (data == 1201){
+                            $scope.orderType.normal = true;
+                        }else if(data == 1202){
+                            $scope.orderType.preSale = true;
+                        }else if(data == 1203){
+                            $scope.orderType.bill = true;
+                        }
+                    })
+                }
+                if ($scope.modifyRule.areas){
+                    var data = angular.fromJson($scope.modifyRule.areas);
+                    $scope.mapArray = data;
+                }
             }else {
-                $state.go('vendor_deliveryRule_add');
+                $scope.isModify = false;
+                $scope.modifyRule = {};
+                $scope.isActive = true;
+                $scope.modifyRule.fareType = 1;
+                $scope.modifyRule.userType = 1301;
+                $scope.orderType = {
+                    normal : true,
+                    preSale : true,
+                    bill : false
+                };
+                Enterprise.getCurrencyByRegisterAddress({}, {} ,function (data) {
+                    if (data){
+                        $scope.modifyRule.currencyName = data.data;
+                    }
+                }, function (error) {
+                    toaster.pop('error', "获取企业币别信息失败");
+                });
+
+                DistributionRule.findCountOfRule({}, {}, function (data) {
+                    if (data){
+                        var num = data.data;
+                        $scope.modifyRule.num = num + 1;
+                    }
+                });
+
+                $scope.fareArray = [];
+                var firstFare = {
+                    start : 0,
+                    end : 0,
+                    fare : 0
+                };
+                var secondFare = {
+                    start : 0,
+                    end : 0,
+                    fare : 0
+                };
+                $scope.fareArray.push(firstFare);
+                $scope.fareArray.push(secondFare);
+            }
+        };
+
+        $scope.loadCityData = function () {
+            $http.get('static/js/prod/data/city.json').success(function (data) {
+                $scope.cityJson = data;
+                $scope.cityData = convert($scope.cityJson);
+            }).error(function (res) {
+                console.log(res);
+            });
+
+            DistributionRule.findAllRuleName({},{},function (data) {
+                $scope.nameArray = data;
+            })
+        };
+        $scope.loadCityData();
+
+        $scope.repeatError = false;
+        $scope.checkRuleName = function () {
+            var k = 1;
+            angular.forEach($scope.nameArray, function (item) {
+                if (item == $scope.rule.ruleName){
+                    k = 0;
+                    return;
+                }
+            });
+            if (k == 1){
+                $scope.repeatError = false;
+            }else {
+                $scope.repeatError = true;
+            }
+        };
+
+        /**
+         * 添加一个分段费用
+         * @param data
+         */
+        $scope.addQtyFare = function (data) {
+            var fare = {
+                start : data.end,
+                end : 0,
+                fare : 0
+            };
+            $scope.fareArray.push(fare);
+        };
+
+        /**
+         * 删除一个分段费用
+         * @param index
+         */
+        $scope.deleteQtyFare = function (index) {
+            $scope.fareArray[index+1].start = $scope.fareArray[index-1].end;
+            $scope.fareArray.splice(index, 1);
+        };
+
+        $scope.inputFare = function (data) {
+            if(!data.fare) {
+                data.fare = 0;
+                return false;
+            }
+            if(isNaN(data.fare)){
+                data.fare = 0;
+                toaster.pop('warning', '提示', '运费必须是整数');
+                return false;
+            }
+            if(Number(data.fare) < 0 || Number(data.fare) % 1 != 0) {
+                data.fare = 0;
+                toaster.pop('warning', '提示', '运费必须是整数');
+                return false;
+            }
+            if(Number(data.fare) > 100000){
+                data.fare = 100000;
+            }
+            data.fare = Number(data.fare);
+        };
+
+        $scope.inputUniform = function () {
+            if(!$scope.rule.uniformPrice) {
+                $scope.rule.uniformPrice = 0;
+                return false;
+            }
+            if(isNaN($scope.rule.uniformPrice)){
+                $scope.rule.uniformPrice = 0;
+                toaster.pop('warning', '提示', '运费必须是整数');
+                return false;
+            }
+            if(Number($scope.rule.uniformPrice) < 0 || Number($scope.rule.uniformPrice) % 1 != 0) {
+                data.fare = 0;
+                toaster.pop('warning', '提示', '运费必须是整数');
+                return false;
+            }
+            if(Number($scope.rule.uniformPrice) > 100000){
+                $scope.rule.uniformPrice = 100000;
+            }
+            data.fare = Number($scope.rule.uniformPrice);
+        };
+
+        $scope.inputQtyFare = function (data, index) {
+            if(!data.start && !data.end) {
+                data.start = 0;
+                data.end = 0;
+                return false;
+            }
+            if(isNaN(data.start) || isNaN(data.end)) {
+                data.end = data.start + 1;
+                $scope.fareArray[index+1].start = Number(data.end);
+                toaster.pop('warning', '提示', '金额必须是数字');
+                return false;
+            }
+            if(Number(data.start) < 0) {
+                data.start = 0;
+                toaster.pop('warning', '提示', '金额必须大于0');
+                return false;
+            }
+            if(Number(data.end) < 0){
+                data.end = data.start + 1;
+                $scope.fareArray[index+1].start = Number(data.end);
+                toaster.pop('warning', '提示', '金额必须大于0');
+                return false;
+            }
+            if(Number(data.end) <= Number(data.start)){
+                data.end = data.start + 1;
+            }
+            if(Number(data.start) > 100000){
+                data.start = 100000;
+            }
+            if(Number(data.end) > 100000){
+                data.end = 100000;
+            }
+            data.start = Number(data.start);
+            data.end = Number(data.end);
+            $scope.fareArray[index+1].start = Number(data.end);
+        };
+
+        $scope.saveDistributionRule = function (isAdd) {
+            console.log(angular.toJson($scope.fareArray));
+            console.log(angular.toJson($scope.mapArray));
+            $scope.checkRuleName();
+            if (!$scope.modifyRule.shippingMethod){
+                toaster.pop('error', "请选择配送方式");
+                return;
+            }
+            if(!$scope.modifyRule.ruleName){
+                toaster.pop('error', "请填写规则名称");
+                return;
+            }
+            if($scope.repeatError){
+                toaster.pop('error', "该规则名称已存在,请修改");
+                return;
+            }
+            if(!$scope.orderType.normal && !$scope.orderType.preSale && !$scope.orderType.bill){
+                toaster.pop('error', "请选择适用类型");
+                return;
+            }
+            if(!$scope.modifyRule.userType){
+                toaster.pop('error', "请选择适用类型");
+                return;
+            }
+
+            //拼接适用类型
+            var typeArray = [];
+            if ($scope.orderType.normal){
+                typeArray.push(1201);
+            }
+            if ($scope.orderType.preSale){
+                typeArray.push(1202);
+            }
+            if ($scope.orderType.bill){
+                typeArray.push(1203);
+            }
+            $scope.modifyRule.orderType = typeArray.join("-");
+            if ($scope.modifyRule.fareType == 2){
+                $scope.modifyRule.qtyFare = angular.toJson($scope.fareArray);
+            }
+            $scope.modifyRule.qtyArea = angular.toJson($scope.mapArray);
+            DistributionRule.saveRule({isAdd:isAdd, isActive:$scope.isActive}, $scope.modifyRule , function (data) {
+                if (data){
+                    // $scope.loadDeliveryRule();
+                    if (isAdd){
+                        toaster.pop('info', "保存成功");
+                    }else{
+                        toaster.pop('info', "新增规则成功");
+                    }
+                }
+            },function (error) {
+                toaster.pop('error', "保存配送规则失败");
+            })
+        };
+
+        // 切换计费类型
+        $scope.checkTab = function (t) {
+            $scope.modifyRule.fareType = t;
+        };
+
+        $scope.chooseBox = false;
+        $scope.cancel = function () {
+            $scope.resetData($scope.tree.$data);
+            $scope.tree.initData($scope.mapArray);
+            $scope.chooseBox = false;
+        };
+
+        $scope.cancelEdit = function () {
+            $scope.editFrame = false;
+            $scope.tab = 'deliverRule';
+        };
+
+        $scope.resetData = function (items) {
+            angular.forEach(items, function (item) {
+                item.checked = false;
+                item.selectedNum = 0;
+                if (item.items){
+                    $scope.resetData(item.items);
+                }
+            });
+        };
+
+        $scope.showSelectedData = function () {
+            $scope.mapArray = [];
+            $scope.mapArray = $scope.tree.getChecked();
+            if ($scope.mapArray.length == 0){
+                toaster.pop("info", "您还没有选择任何地区");
+                return;
             }
+            $scope.tree.initData($scope.mapArray);
+            $scope.chooseBox = false;
+        };
 
+        $scope.deleteMapItem = function (index) {
+            $scope.mapArray.splice(index, 1);
         };
 
+        /**
+         * 将本地地址数据转化为可用的结构
+         * @param item
+         * @returns {Array}
+         */
+        function convert(item) {
+            var arr = [];
+            if(angular.isArray(item)) {
+                angular.forEach(item, function (v) {
+                    arr.push({
+                        label: v
+                    })
+                })
+            } else {
+                angular.forEach(item, function (v, k) {
+                    arr.push({
+                        label: k,
+                        items: convert(v),
+                        selectedNum : 0,
+                        folded: true
+                    })
+                })
+            }
+            return arr;
+        }
+        // 选择地区
+        $scope.chooseAddress = function () {
+            $scope.chooseBox = true;
+            $scope.tree = new TreeData($scope.cityData);
+            $scope.tree.initData($scope.mapArray);
+        }
+
+        /**
+         * 切换生效状态
+         * @param rule
+         * @param isAdd
+         * @param active
+         */
         $scope.changeActive = function (rule, isAdd, active) {
             DistributionRule.saveRule({isAdd:isAdd,isActive:active}, rule, function (data) {
                 if (data){
@@ -54,7 +393,10 @@ define([ 'app/app' ], function(app) {
             $scope.deleteObject = data;
         };
 
-        //删除地址
+        /**
+         * 根据id删除指定配送规则
+         * @param id
+         */
         $scope.deleteRule = function (id) {
             DistributionRule.deleteOne({id:id}, {}, function () {
                 $scope.deleteFrame = false;
@@ -71,17 +413,6 @@ define([ 'app/app' ], function(app) {
         $scope.loadDeliveryRule = function () {
             $scope.ruleTableParams.page(1);
             $scope.ruleTableParams.reload();
-            $scope.getTakeSelfName();
-        };
-
-        $scope.getTakeSelfName = function () {
-            DistributionRule.findAllRuleName({}, {}, function (data) {
-                if (data){
-                    $scope.nameArray = data;
-                }
-            },function (error) {
-                toaster.pop('error', "获取配送规则名称失败")
-            })
         };
 
         //取消删除
@@ -90,4 +421,220 @@ define([ 'app/app' ], function(app) {
         };
 
     }]);
+
+    // 地区选择
+    app.register.factory('TreeData', function(){
+        return function (tree) {
+            var me = this;
+            me.$data = tree;
+
+            me.initData = function (initData) {
+                if(initData) {
+                    angular.forEach(initData, function (v) {
+                        var p = {};
+                        for(var i in me.$data) {
+                            var value = me.$data[i];
+                            if(value.label == v.province) {
+                                p = value; break;
+                            }
+                        }
+                        p.checked = true;
+                        if(v.city) {
+                            var c = {};
+                            for(var i in p.items) {
+                                var value = p.items[i];
+                                if(value.label == v.city) {
+                                    c = value; break;
+                                }
+                            }
+                            c.checked = true;
+                            if(v.area) {
+                                for(var i in c.items) {
+                                    var value = c.items[i];
+                                    if(value.label == v.area) {
+                                        value.checked = true; break;
+                                    }
+                                }
+                            } else {
+                                angular.forEach(c.items, function (area) {
+                                    area.checked = true;
+                                })
+                            }
+                        } else {
+                            angular.forEach(p.items, function (city) {
+                                city.checked = true;
+                                angular.forEach(city.items, function (area) {
+                                    area.checked = true;
+                                })
+                            })
+                        }
+                    })
+                    me._updateParentsCheck(me.$data);
+                }
+            };
+
+
+            /**
+             * 折叠或展开文件夹
+             * @param item
+             * @param folded
+             */
+            me.toggleFold = function (item, folded) {
+                item.folded = angular.isUndefined(folded) ? !item.folded : folded;
+            }
+
+            me.getLastItems = function (item) {
+                while (item.items){
+                    item = item.items;
+                }
+                return item;
+            };
+
+            /**
+             * 折叠文件夹
+             * @param item
+             */
+            me.fold = function (item) {
+                item.folded = true;
+            }
+
+            /**
+             * 展开文件夹
+             * @param item
+             */
+            me.unFold = function (item) {
+                item.folded = false;
+            }
+
+            /**
+             * 选中单个
+             * @param item
+             */
+            me.check = function (item) {
+                me._updateChildrenCheck(item);
+                me._updateParentsCheck(me.$data);
+                // me.getChecked();
+            }
+
+            /**
+             * 更新子树的选中状态
+             * @param item
+             * @private
+             */
+            me._updateChildrenCheck = function (item) {
+                if(item.items) {
+                    item.selectedNum = item.checked ? item.items.length : 0;
+                    angular.forEach(item.items, function (v) {
+                        v.checked = item.checked;
+                        me._updateChildrenCheck(v);
+                    })
+                }
+            }
+
+            /**
+             * 根据子树状态更新父节点选中状态
+             * @param items
+             * @private
+             */
+            me._updateParentsCheck = function (items) {
+                angular.forEach(items, function (d) {
+                    if(d.items) {
+                        me._updateParentsCheck(d.items);
+                        d.checked = me._hasCheckedChildren(d);
+                        d.semiChecked = me._hasUncheckedChildren(d);
+                    }
+                })
+            }
+
+
+            /**
+             * 判断是否有选中的子树
+             * @param item
+             * @returns {boolean}
+             * @private
+             */
+            me._hasCheckedChildren = function (item) {
+                var result = false;
+                var count = 0;
+                angular.forEach(item.items, function (v) {
+                    result = result || v.checked;
+                    if (v.checked){
+                        count++;
+                    }
+                    if(v.items && !result) {
+                        result = result || me._hasCheckedChildren(v);
+                    }
+                })
+                item.selectedNum = count;
+                return result;
+            }
+
+            /**
+             * 判断是否有没有选中的子树
+             * @param item
+             * @returns {boolean}
+             * @private
+             */
+            me._hasUncheckedChildren = function (item) {
+                var result = false;
+                angular.forEach(item.items, function (v) {
+                    result = result || !v.checked;
+                    if(v.items && !result) {
+                        result = result || me._hasUncheckedChildren(v);
+                    }
+                })
+                return result;
+            }
+
+            /**
+             * 是否半选中
+             * @param item
+             * @returns {boolean|*}
+             */
+            me.isSemiChecked = function (item) {
+                return item.checked && item.semiChecked;
+            }
+
+            /**
+             * 获取所有选中的数据
+             */
+            me.getChecked = function () {
+                var addressArray = [];
+                angular.forEach(me.$data, function (v) {
+                    if(v.checked) {
+                        if(!v.semiChecked) {
+                            var first = {
+                                province : v.label
+                            };
+                            addressArray.push(first);
+                        } else {
+                            angular.forEach(v.items, function (data) {
+                                if (data.checked){
+                                    if(!data.semiChecked) {
+                                        var second = {
+                                            province : v.label,
+                                            city : data.label
+                                        };
+                                        addressArray.push(second);
+                                    }else {
+                                        angular.forEach(data.items, function (item) {
+                                            if (item.checked){
+                                                var third = {
+                                                    province : v.label,
+                                                    city : data.label,
+                                                    area : item.label
+                                                };
+                                                addressArray.push(third);
+                                            }
+                                        })
+                                    }
+                                }
+                            });
+                        }
+                    }
+                });
+                return addressArray;
+            }
+        }
+    })
 });

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

@@ -213,18 +213,25 @@
 <!--右侧主体部分-->
 <div class="count user_right fr">
 	<div class="count_center">
-		<div class="com_tab" style="position: relative">
+		<div class="com_tab rule-act" style="position: relative">
 			<ul class="fl">
 				<!--<li ng-class="{'active': tab=='deliverRule'}"><a ui-sref="vendor_deliveryRule">配送规则</a></li>-->
-				<li ng-class="{'active': tab=='deliverRule'}"><a ui-sref="vendor_deliveryRule">配送规则</a></li>
+				<li ng-class="{'active': tab=='deliverRule'}"><a ng-click="toggleTab('deliverRule')" ui-sref="vendor_deliveryRule">配送规则</a></li>
 				<li ng-class="{'active': tab=='distributor'}"><a ui-sref="vendor_distributor">配送商</a></li>
 				<li ng-class="{'active': tab=='takeSelf'}"><a ui-sref="vendor_takeSelf">自提点</a></li>
 				<li ng-class="{'active': tab=='logistic'}"><a ui-sref="vendor_logistics">发货地址</a></li>
 			</ul>
-
+			<!--配送规则导航-->
+			<div class="addRule-menu" ng-if="editFrame">
+                <span class="active">
+                    <a ng-if="!isModify" ng-click="toggleTab('editRule')">新增配送规则</a>
+					<a ng-if="isModify" ng-click="toggleTab('editRule')">修改配送规则</a>
+                    <i class="fa fa-remove" ng-click="cancelEdit()"></i>
+                </span>
+			</div>
 		</div>
 		<!--配送规则列表-->
-		<div class="delivery-list">
+		<div class="delivery-list" ng-if="tab=='deliverRule'">
 			<div class="content-header">
 				<a ng-click="editRule()"><i class="fa fa-plus-circle"></i>&nbsp;新增配送规则</a>
 				<span>已设置的配送规则</span>
@@ -275,6 +282,286 @@
 				</table>
 			</div>
 		</div>
+		<!--新增修改配送规则-->
+		<div class="rule-main" ng-if="tab=='editRule'">
+			<div class="rule-title">基本信息</div>
+			<div class="rule-content">
+				<div class="row">
+					<span><strong>*</strong>配送方式</span>
+					<select class="select-adder form-control delivery" ng-model="modifyRule.shippingMethod">
+						<option value="">请选择配送方式</option>
+						<option value="1301">第三方配送</option>
+						<option value="1302">卖家配送</option>
+						<option value="1303">上门自提</option>
+					</select>
+					<span style="width: 70px;">优先级排序</span>
+					<input type="text" class="form-control sort" ng-model="modifyRule.num">
+					<span><strong>*</strong>规则名称</span>
+					<input type="text" class="form-control rule" style="text-align: left;" ng-blur="checkRuleName()" ng-model="modifyRule.ruleName">
+				</div>
+				<div class="row radio-1">
+					<span>是否生效</span>
+					<label class="check-act">
+						<input type="radio" id="effect" name="radio" value="true" ng-click="isActive=true" ng-checked="isActive">
+						<label for="effect"></label>
+						生效
+					</label>
+					<label class="check-act">
+						<input type="radio" id="no-effect" name="radio" value="false" ng-click="isActive=false" ng-checked="!isActive">
+						<label for="no-effect"></label>
+						暂不生效
+					</label>
+				</div>
+			</div>
+			<!--适用范围-->
+			<div class="rule-title">适用范围</div>
+			<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>
+						<!--<option value="2">所有用户</option>-->
+						<!--<option value="3">所有用户</option>-->
+					</select>
+				</div>
+				<div class="row" style="position: relative;">
+					<span>适用地区</span>
+					<div class="area-content">
+						<!--<span ng-repeat="data in tree.getChecked()">{{data.province}}{{data.city}}{{data.area}}</span>-->
+						<!--<span ng-repeat="data in tree.addressArray">{{data.province}}{{data.city}}{{data.area}}</span>-->
+						<span ng-repeat="data in mapArray" ng-click="deleteMapItem($index)">
+							<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>
+						</span>
+					</div>
+					<button ng-click="chooseAddress()">选择地区</button>
+					<!--选择地区 begin-->
+					<div class="choose-box" ng-show="chooseBox">
+						<div>
+							<div class="tree">
+								<ul>
+									<li ng-repeat="address in tree.$data">
+										<div>
+											<i class="fa fa-fw" ng-class="address.folded?'fa-caret-right':'fa-caret-down'" ng-click="tree.toggleFold(address)"></i>
+											<span ng-bind="::address.label" ng-click="tree.toggleFold(address)"></span><em ng-if="address.selectedNum!=0 && address.selectedNum!=address.items.length">({{address.selectedNum}})</em>
+											<div class="check-1">
+												<label class="check-act" ng-class="{'intermediate': tree.isSemiChecked(address)}">
+													<input type="checkbox" ng-model="address.checked" ng-change="tree.check(address)"  id="{{address.label}}">
+													<label for="{{address.label}}"></label>
+												</label>
+											</div>
+										</div>
+										<ul ng-hide="address.folded">
+											<li ng-repeat="city in address.items">
+												<div>
+													<i ng-if="city.items" class="fa fa-fw" ng-class="city.folded?'fa-caret-right':'fa-caret-down'" ng-click="tree.toggleFold(city)"></i>
+													<span ng-bind="::city.label" ng-click="tree.toggleFold(city)"></span><em ng-if="city.selectedNum!=0 && city.selectedNum!=city.items.length">({{city.selectedNum}})</em>
+													<div class="check-1">
+														<label class="check-act" ng-class="{'intermediate': tree.isSemiChecked(city)}" >
+															<input type="checkbox" ng-model="city.checked" ng-change="tree.check(city)" id="{{city.label}}">
+															<label for="{{city.label}}"></label>
+														</label>
+													</div>
+												</div>
+												<ul ng-hide="city.folded">
+													<li ng-repeat="area in city.items">
+														<label style="width: 100%;">
+															<span ng-bind="::area.label"></span>
+															<div class="check-1">
+																<label class="check-act">
+																	<input type="checkbox" ng-model="area.checked" ng-change="tree.check(area)" id="{{area.label}}">
+																	<label for="{{area.label}}"></label>
+																</label>
+															</div>
+														</label>
+													</li>
+												</ul>
+											</li>
+										</ul>
+									</li>
+								</ul>
+							</div>
+							<div class="deal-btn">
+								<a ng-click="cancel()" class="off">取消</a>
+								<a ng-click="showSelectedData()" class="ok">确认</a>
+							</div>
+						</div>
+					</div>
+					<!--<i class="notes">默认对全部地区生效</i>-->
+				</div>
+			</div>
+			<!--计费方式-->
+			<div class="rule-title">计费方式</div>
+			<div class="rule-content">
+				<div class="row radio-1">
+					<span>计费方式</span>
+					<label class="check-act" ng-click="checkTab(1)">
+						<input type="radio" id="style01" name="radio2" ng-checked="modifyRule.fareType==1"/>
+						<label for="style01"></label>
+						统一规定运费
+					</label>
+					<label class="check-act" ng-click="checkTab(2)">
+						<input type="radio" id="style02" name="radio2" ng-checked="modifyRule.fareType==2"/>
+						<label for="style02"></label>
+						按总金额计算
+					</label>
+				</div>
+				<!--统一规定运费-->
+				<div class="style-regulations common-style" ng-if="modifyRule.fareType==1">
+					<div class="row dot">
+						<span>统一运费</span>
+						<div class="price-input">
+							<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="inputUniform()" ng-model="modifyRule.uniformPrice" />
+						</div>
+					</div>
+					<div class="row" style="background: none; padding: 0;">
+						<span class="f14">计算说明</span>
+						<!--可编辑-->
+						<!--<div class="edit">-->
+						<!--<textarea class="form-control" placeholder="全国统一运费 $20"></textarea>-->
+						<!--<div class="prompt"><strong>*</strong>公式说明内容将会在购物车中显示,可自行修改</div>-->
+						<!--</div>-->
+						<!--不可以编辑的状态-->
+						<div class="no-edit">全国统一运费
+							<em ng-if="modifyRule.currencyName=='RMB'">¥</em>
+							<em ng-if="modifyRule.currencyName=='USD'">$</em>
+							{{modifyRule.uniformPrice}}
+						</div>
+					</div>
+				</div>
+				<!--按总金额计算-->
+				<div class="style-price common-style" ng-if="modifyRule.fareType==2">
+					<!--<div class="row dot">-->
+					<!--<span>总金额在</span>-->
+					<!--<div class="price-input">-->
+					<!--<i class="currency" ng-if="rule.currencyName=='RMB'">¥</i>-->
+					<!--<i class="currency" ng-if="rule.currencyName=='USD'">$</i>-->
+					<!--<input type="text" class="form-control" placeholder="0" />-->
+					<!--<em>以下,</em>-->
+					<!--</div>-->
+					<!--<div class="price-input">-->
+					<!--<em>运费为</em>-->
+					<!--<i class="currency">$</i>-->
+					<!--<input type="text" class="form-control" placeholder="0" />-->
+					<!--</div>-->
+					<!--</div>-->
+					<div class="row" ng-repeat="data in fareArray" ng-class="{'dot' : $index==0}">
+						<span>总金额在</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" ng-blur="inputQtyFare(data, $index)" placeholder="0" ng-model="data.end" />
+							以下,
+						</div>
+						<div class="price-input" ng-if="$index != 0 && $index != fareArray.length - 1">
+							<em>
+								<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
+								<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>
+								<i ng-bind="fareArray[$index-1].end"></i>以上,
+							</em>
+							<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
+							<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>
+							<input type="text" class="form-control" ng-blur="inputQtyFare(data, $index)" ng-model="data.end" placeholder="100" />
+							<em>以下,</em>
+						</div>
+						<div class="price-input" ng-if="$index == fareArray.length - 1">
+							<em>
+								<i class="currency" ng-if="modifyRule.currencyName=='RMB'">¥</i>
+								<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>
+								<i ng-bind="fareArray[$index-1].end"></i>以上,
+							</em>
+						</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>
+							<input type="text" class="form-control" ng-blur="inputFare(data)" ng-model="data.fare" placeholder="0" />
+						</div>
+						<div class="add-box">
+							<span class="add" ng-if="$index == fareArray.length - 1 && fareArray.length < 5" ng-click="addQtyFare(data)"><i class="fa fa-plus-circle"></i></span>
+							<span class="reduce" ng-if="$index != 0 && $index != fareArray.length - 1" ng-click="deleteQtyFare($index)"><i class="fa fa-minus-circle"></i></span>
+						</div>
+					</div>
+					<!--<div class="row">-->
+					<!--<span>总金额在</span>-->
+					<!--<div class="price-input">-->
+					<!--<em><i>$1000</i>以上,</em>-->
+					<!--</div>-->
+					<!--<div class="price-input">-->
+					<!--<em>运费为</em>-->
+					<!--<i class="currency">$</i>-->
+					<!--<input type="text" class="form-control" placeholder="2000" />-->
+					<!--</div>-->
+					<!--<button style="margin-left: 20px;">增加范围</button>-->
+					<!--</div>-->
+					<!--计算说明-->
+					<div class="row" style="background: none; padding: 0; margin-top: 10px !important;">
+						<span class="f14">计算说明</span>
+						<div class="no-edit">
+							<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-if="modifyRule.currencyName=='RMB'">¥</i>
+									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.fare}}
+								</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-if="modifyRule.currencyName=='RMB'">¥</i>
+									<i class="currency" ng-if="modifyRule.currencyName=='USD'">$</i>{{data.fare}}
+								</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}}
+								</p>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<!--操作取消保存-->
+			<div class="deal-btn">
+				<a ng-click="saveDistributionRule(false)" ng-if="isModify" class="save-other">另存为新规则</a>
+				<a ng-click="cancelEdit()" class="off">取消</a>
+				<a ng-click="saveDistributionRule(true)" class="ok">保存</a>
+			</div>
+		</div>
 	</div>
 </div>
 <!--防误删-->
@@ -286,4 +573,470 @@
 		<p><i class="fa fa-exclamation-circle"></i>是否要删除此规则?</p>
 		<div><a ng-click="cancelDelete()">取消</a><a ng-click="deleteRule(deleteObject.id)">确认</a></div>
 	</div>
-</div>
+</div>
+<style>
+	.count .count01 {
+		display: block;
+	}
+	/*新增规则*/
+	.addRule-menu{
+		width: 100%;
+		height: 20px;
+		line-height: 20px;
+		position: absolute;
+		top: 40px;
+	}
+	.addRule-menu span{
+		display: inline-block;
+		text-align: center;
+		width: 112px;
+		height: 20px;
+		background: #eee;
+		border-top-left-radius: 3px;
+		border-top-right-radius: 3px;
+		margin-left: 518px;
+		line-height: 19px;
+		position: relative;
+		bottom: 20px;
+	}
+	.addRule-menu span a{
+		font-size: 12px;
+		color: #999;
+		display: inline-block;
+		height: 20px;
+		width: 75px;
+	}
+	.addRule-menu span.active{
+		background: #fff;
+		border: #82d2fa 1px solid;
+		border-bottom: #fff 1px solid;
+	}
+	.addRule-menu span.active a{
+		color: #666;
+	}
+	.addRule-menu span i{
+		font-size: 14px;
+		color: #999;
+	}
+	.addRule-menu span i:hover,.addRule-menu span a:hover{
+		color: #5078cb;
+	}
+	.com_tab.rule-act ul {
+		border-bottom: #82d2fa 1px solid;
+	}
+	.com_tab.rule-act{
+		margin-bottom: 0;
+	}
+
+	/*内容开始*/
+	.rule-main{
+		width: 100%;
+		margin: 0 auto;
+		background: #fff;
+		padding-bottom: 20px;
+	}
+	.rule-main .rule-title{
+		width: 100%;
+		margin: 0 auto;
+		height: 40px;
+		line-height: 50px;
+		font-size: 14px;
+		color: #5078cb;
+		padding-left: 35px;
+		font-weight: bold;
+	}
+	.rule-main .rule-content{
+		width: 97%;
+		margin: 0 auto;
+		background: #f5f8fe;
+		padding: 10px 20px;
+	}
+	.rule-main .rule-content .row{
+		margin: 0;
+		font-size: 14px;
+		color: #666;
+		line-height: 26px;
+		margin-bottom: 10px;
+	}
+	.rule-main .rule-content .row span{
+		font-size: 14px;
+		line-height: 26px;
+		margin-right: 15px;
+		display: inline-block;
+		width: 63px;
+		text-align: right;
+	}
+	.rule-main .rule-content .row span,.rule-main .rule-content .row select,.rule-main .rule-content .row input,.rule-main .rule-content .row label{
+		float: left;
+	}
+	.rule-main .rule-content .row input{
+		text-align: center;
+	}
+	.rule-main .rule-content .row strong{
+		color: #f00;
+	}
+	.rule-main .rule-content .row .form-control{
+		border-radius: 0;
+		height: 26px;
+		padding: 0 10px;
+		line-height: 26px;
+		border: #d4d4d4 1px solid;
+		margin-right: 40px;
+		font-size: 12px;
+	}
+	.rule-main .rule-content .row label{
+		font-weight: inherit;
+		margin-right: 40px;
+	}
+	.rule-main .rule-content .row label input{
+		margin: 7px 8px 0;
+	}
+	.rule-main .rule-content .row select.delivery{
+		width: 130px;
+	}
+	.rule-main .rule-content .row input.sort{
+		width: 100px;
+	}
+	.rule-main .rule-content .row input.rule{
+		width: 350px;
+		margin-right: 0;
+	}
+	.rule-main .rule-content .row select.for-people{
+		width: 220px;
+	}
+	.rule-main .rule-content .row button{
+		width: 70px;
+		height: 22px;
+		line-height: 22px;
+		text-align: center;
+		color: #fff;
+		background: #ff8522;
+		border: none;
+	}
+	.rule-main .rule-content .row .check-act input{
+		display: none;
+	}
+	.rule-main .rule-content .check-act label{
+		width: 12px;
+		height: 12px;
+		margin-right: 5px;
+		display: inline-block;
+		background: url(static/img/icon/check-rule.png) no-repeat;
+		position: relative;
+		top: 7px;
+	}
+	.rule-main .rule-content .radio-1 .check-act label{
+		background-position: 0 0;
+	}
+	.rule-main .rule-content .check-1 .check-act label{
+		background-position: -48px 0;
+	}
+	.rule-main .rule-content .radio-1 input:checked + label{
+		background-position: -15px 0;
+	}
+	.rule-main .rule-content .check-1 input:checked + label{
+		background-position: -31px 0;
+	}
+	.rule-main .rule-content i.notes{
+		font-size: 12px;
+		color: #999;
+	}
+	.rule-main .rule-content .common-style{
+		width: 900px;
+		margin-right: 0 auto;
+	}
+	.rule-main .rule-content .common-style .row{
+		padding: 8px;
+		background: #e8e7e7;
+		min-height: 40px;
+		font-size: 12px;
+	}
+	.rule-main .rule-content .common-style .row span{
+		font-size: 12px;
+	}
+	.rule-main .rule-content .common-style .price-input{
+		min-width: 90px;
+		float: left;
+		position: relative;
+		z-index: 10;
+	}
+	.rule-main .rule-content .common-style .price-input em{
+		float: left;
+		margin: 0 5px;
+	}
+	.rule-main .rule-content .common-style .price-input em i{
+		margin-right: 20px;
+	}
+	.rule-main .rule-content .common-style .price-input i.currency{
+		width: 20px;
+		height: 26px;
+		text-align: center;
+		display: inline-block;
+		background: #b0b0b0;
+		color: #fff;
+		float: left;
+		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;
+		position: relative;
+		/*left: -1px;*/
+		font-size: 12px;
+	}
+	.rule-main .rule-content .common-style .row textarea{
+		width: 600px;
+		height: 84px;
+		font-size: 12px;
+		float: left;
+		margin-right: 0 !important;
+	}
+	.rule-main .rule-content .common-style .row .prompt{
+		float: left;
+		width: 110px;
+		margin-left: 30px;
+		line-height: 20px;
+		color: #999;
+	}
+	.rule-main .rule-content .common-style .row .no-edit{
+		width: 824px;
+		min-height: 40px;
+		background: #e8e7e7;
+		float: right;
+		margin-right: 0 !important;
+		padding-left: 10px;
+		line-height: 40px;
+	}
+	.rule-main .rule-content .common-style .row .edit{
+		width: 824px;
+		margin: 0 auto;
+		float: right;
+	}
+	/*操作取消保存*/
+	.deal-btn{
+		width: 100%;
+		margin: 0 auto;
+		text-align: center;
+		margin-top: 15px;
+	}
+	.deal-btn a{
+		width: 70px;
+		height: 30px;
+		display: inline-block;
+		text-align: center;
+		line-height: 30px;
+		font-size: 14px;
+	}
+	.deal-btn a.off{
+		background: #cdcccc;
+		color: #666;
+		margin-right: 8px;
+	}
+	.deal-btn a.save-other{
+		width: 100px;
+		background: #ff8522;
+		color: #fff;
+		margin-right: 8px;
+	}
+	.deal-btn a.ok{
+		background: #5078cb;
+		color: #fff;
+	}
+	.deal-btn a:hover{
+		background: #337ab7;
+		color: #fff;
+	}
+	/*适用地区*/
+	.rule-main .rule-content .area-content{
+		width: 715px;
+		min-height: 30px;
+		padding: 5px 5px 2px 5px;
+		background: #fff;
+		float: left;
+		margin-right: 30px;
+	}
+	.rule-main .rule-content .area-content span{
+		font-size: 12px;
+		color: #666;
+		display: inline-block;
+		padding: 0 3px;
+		border-radius: 2px;
+		float: left;
+		margin: 1px 1px 6px 1px;
+		margin-right: 3px;
+		height: 22px;
+		background: #e6eefe;
+		width: auto;
+	}
+	.rule-main .rule-content .area-content span em{
+		display: inline-block;
+		max-width: 150px;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		line-height: 22px;
+		float: left;
+	}
+	.rule-main .rule-content .area-content span i{
+		color: #cddcfb;
+		margin-left: 3px;
+		font-size: 16px;
+		background: #fff;
+		height: 10px;
+		position: relative;
+		border-radius: 100%;
+	}
+	.rule-main .rule-content .area-content span i:before{
+		position: relative;
+		top: -1px;
+	}
+	.rule-main .rule-content .area-content span:hover{
+		background: #8eb0f5;
+		cursor: pointer;
+	}
+	.rule-main .rule-content .area-content span:hover em{
+		color: #fff;
+	}
+	.rule-main .rule-content .area-content span:hover i{
+		color: #ef4646;
+	}
+	.rule-main .rule-content .common-style.style-price .row{
+		margin-bottom: 0 !important;
+	}
+	.rule-main .rule-content .common-style.style-price .row .no-edit{
+		padding: 8px 10px;
+	}
+	.rule-main .rule-content .common-style.style-price .row .no-edit p{
+		line-height: 25px;
+	}
+	.rule-main .rule-content .common-style .row{
+		position: relative;
+	}
+	.rule-main .rule-content .common-style .row.dot:before{
+		content: "";
+		width: 15px;
+		height: 15px;
+		display: inline-block;
+		background: #e8e7e7;
+		transform: rotate(-45deg);
+		position: absolute;
+		top: -5px;
+		left: 129px;
+		z-index: 1;
+	}
+	.rule-main .rule-content .common-style.style-price .row.dot:before{
+		left: 260px;
+	}
+	.add-box span{
+		margin: 0 1px;
+		position: relative;
+		top: 1px;
+		border: none;
+	}
+	.add-box span i{
+		font-size: 16px;
+	}
+	.add-box .reduce{
+		color: #ff8522;
+	}
+	.add-box span:hover{
+		cursor: pointer;
+	}
+	.add-box .add{
+		color: #32b500;
+	}
+
+	/*选择地区*/
+	.choose-box{
+		width: 320px;
+		height: 438px;
+		box-shadow: 2px 5px 8px #dee0e2;
+		position: absolute;
+		top: 120%;
+		left: 487px;
+		background: #fff;
+		z-index: 10000;
+		border: #e6eefe 1px solid;
+		border-radius: 5px;
+	}
+	.choose-box:after{
+		content: "";
+		width: 15px;
+		height: 15px;
+		display: inline-block;
+		background: #fff;
+		transform: rotate(-45deg);
+		position: absolute;
+		top: -8px;
+		left: 142px;
+		z-index: 1;
+		border: #e6eefe 1px solid;
+		border-bottom: none;
+		border-left: none;
+	}
+	.choose-box .tree{
+		width: 290px;
+		max-height: 364px;
+		overflow-y: auto;
+		margin: 0 auto;
+		border: #e8e9ea 1px solid;
+		padding-top: 15px;
+		margin-top: 16px;
+	}
+	.choose-box .tree li {
+		cursor: pointer;
+		padding-left: 1.3em;
+		width: 100%;
+		float: left;
+	}
+
+	.choose-box .tree ul {
+		list-style: none;
+		padding-left: 0;
+	}
+
+	.choose-box .intermediate {
+		opacity: 0.3;
+	}
+	.choose-box .tree ul i{
+		float: left;
+		font-size: 18px;
+		position: relative;
+		top: 3px;
+		right: 0;
+		color: #ff8522;
+	}
+	.choose-box .tree ul i.fa-fw{
+		width: 1em;
+	}
+
+	.choose-box .tree ul div.check-1{
+		float: right;
+	}
+	.choose-box .tree ul li span{
+		color: #666;
+		line-height: 24px !important;
+		margin-right: 3px !important;
+	}
+	.choose-box .tree ul li em{
+		color: #999;
+		font-size: 12px;
+		position: relative;
+		top: -2px;
+		left: 2px;
+	}
+	.rule-main .rule-content .row .choose-box .tree ul li span{
+		width: auto;
+	}
+	.choose-box .hidden {
+		display: none;
+	}
+	.choose-box .check-1 input{
+		/*display: none;*/
+	}
+	.rule-main .rule-content .row .choose-box label{
+		margin-right: 12px;
+	}
+</style>