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

供应商资料-新增采购单

yangc 8 лет назад
Родитель
Сommit
ce3960c5fb

+ 1 - 1
src/main/webapp/resources/css/b2bCommon.css

@@ -195,4 +195,4 @@ table.b2b-modal-table tbody tr td {
     position: absolute;
     position: absolute;
     left: 0;
     left: 0;
     top: 22px;
     top: 22px;
-}
+}

+ 96 - 0
src/main/webapp/resources/css/common.css

@@ -1389,4 +1389,100 @@ i.must {
 .inline-block {
 .inline-block {
 	display: inline-block;
 	display: inline-block;
 	vertical-align: middle;
 	vertical-align: middle;
+}
+/*卖家中心补充的样式*/
+.com_tab {
+	height:40px;
+	margin-bottom: 16px;
+}
+.com_tab ul {
+	width: 100%;
+	margin: 0 auto;
+	height:40px;
+	line-height:40px;
+	background: #fff;
+}
+.com_tab ul li {
+	height:40px;
+	text-align: center;
+	float: left;
+	margin-left: 25px;
+}
+.com_tab ul li > a {
+	font-size: 14px;
+	height:40px;
+	padding: 0 20px;
+	display: inline-block;
+}
+.com_tab ul li.active > a {
+	color: #f15601;
+	border-bottom: 3px #5078cb solid;
+}
+.com_tab ul li:hover > a {
+	color: #5078cb;
+	/*border-bottom: 3px #5078cb solid;*/
+}
+.com_tab ul li > a em {
+	color: #e64040;
+}
+.com_tab ul li.active a,.oder01 ul li.active a em {
+	color: #f15601;
+}
+
+.com_tab:nth-of-type(1) ul li{
+	margin-left: 0px;
+	position: relative;
+}
+.com_tab:nth-of-type(1) ul li.active > a{
+	border-bottom: #fff;
+	background: #5078cb;
+	color: #fff !important;
+}
+.com_tab:nth-of-type(1) ul li::after{
+	background: url('../../img/vendor/images/downicon.png');
+	width: 11px;
+	height: 6px;
+	position: absolute;
+	bottom: 0px;
+	left: 50%;
+	content: ' ';
+	margin-left: -5px;
+	display: none;
+}
+.com_tab ul li.active::after{
+	display: block;
+}
+.com_tab:nth-of-type(1) ul li.active:hover > a{
+	color: #fff !important;
+}
+.com_tab:nth-of-type(2) ul li a {
+	color: #666 !important;
+}
+.com_tab:nth-of-type(2) ul li.active a,.com_tab:nth-of-type(2) ul li.active > a em{
+	color: #f15601 !important;
+}
+.com_tab:nth-of-type(2) ul li:hover a,.com_tab:nth-of-type(2) ul li:hover > a em{
+	color: #f15601 !important;
+}
+.com_tab:nth-of-type(2) ul li > a{
+	border-top: 3px solid #fff;
+}
+.com_tab:nth-of-type(2) ul li.active > a{
+	border-top: 3px solid #f15601;
+	border-left: 1px solid #f15601;
+	border-right: 1px solid #f15601;
+	border-bottom: 1px solid #fff
+}
+.com_tab:nth-of-type(2) ul{
+	/*border-top: 3px solid #f15601;*/
+	border-bottom: 1px solid #f15601;
+}
+.com_tab:nth-of-type(2) ul li{
+	margin-left: 0px !important;
+}
+.com_tab:nth-of-type(2) ul li:first-child{
+	margin-left: 0px
+}
+.com_tab:nth-of-type(1) ul li.active:after{
+	display: block
 }
 }

+ 0 - 96
src/main/webapp/resources/css/vendor/sell.css

@@ -3427,102 +3427,6 @@ body {
 .none_add a {
 .none_add a {
     color: #e64040;
     color: #e64040;
 }
 }
-/*卖家中心补充的样式*/
-.com_tab {
-    height:40px;
-    margin-bottom: 16px;
-}
-.com_tab ul {
-    width: 100%;
-    margin: 0 auto;
-    height:40px;
-    line-height:40px;
-    background: #fff;
-}
-.com_tab ul li {
-    height:40px;
-    text-align: center;
-    float: left;
-    margin-left: 25px;
-}
-.com_tab ul li > a {
-    font-size: 14px;
-    height:40px;
-    padding: 0 20px;
-    display: inline-block;
-}
-.com_tab ul li.active > a {
-    color: #f15601;
-    border-bottom: 3px #5078cb solid;
-}
-.com_tab ul li:hover > a {
-    color: #5078cb;
-    /*border-bottom: 3px #5078cb solid;*/
-}
-.com_tab ul li > a em {
-    color: #e64040;
-}
-.com_tab ul li.active a,.oder01 ul li.active a em {
-    color: #f15601;
-}
-
-.com_tab:nth-of-type(1) ul li{
-    margin-left: 0px;
-    position: relative;
-}
-.com_tab:nth-of-type(1) ul li.active > a{
-    border-bottom: #fff;
-    background: #5078cb;
-    color: #fff !important;
-}
-.com_tab:nth-of-type(1) ul li::after{
-    background: url('../../img/vendor/images/downicon.png');
-    width: 11px;
-    height: 6px;
-    position: absolute;
-    bottom: 0px;
-    left: 50%;
-    content: ' ';
-    margin-left: -5px;
-    display: none;
-}
-.com_tab ul li.active::after{
-    display: block;
-}
-.com_tab:nth-of-type(1) ul li.active:hover > a{
-    color: #fff !important;
-}
-.com_tab:nth-of-type(2) ul li a {
-    color: #666 !important;
-}
-.com_tab:nth-of-type(2) ul li.active a,.com_tab:nth-of-type(2) ul li.active > a em{
-    color: #f15601 !important;
-}
-.com_tab:nth-of-type(2) ul li:hover a,.com_tab:nth-of-type(2) ul li:hover > a em{
-    color: #f15601 !important;
-}
-.com_tab:nth-of-type(2) ul li > a{
-    border-top: 3px solid #fff;
-}
-.com_tab:nth-of-type(2) ul li.active > a{
-    border-top: 3px solid #f15601;
-    border-left: 1px solid #f15601;
-    border-right: 1px solid #f15601;
-    border-bottom: 1px solid #fff
-}
-.com_tab:nth-of-type(2) ul{
-    /*border-top: 3px solid #f15601;*/
-    border-bottom: 1px solid #f15601;
-}
-.com_tab:nth-of-type(2) ul li{
-    margin-left: 0px !important;
-}
-.com_tab:nth-of-type(2) ul li:first-child{
-    margin-left: 0px
-}
-.com_tab:nth-of-type(1) ul li.active:after{
-    display: block
-}
 .log_company dl span.wd01 {
 .log_company dl span.wd01 {
     width:10%;
     width:10%;
 }
 }

+ 96 - 0
src/main/webapp/resources/js/common/b2bServices.js

@@ -1148,5 +1148,101 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
                 method: 'GET'
                 method: 'GET'
             }
             }
         });
         });
+    }])
+        .factory('B2bAddtoCart', ['$resource', 'BaseService', function($resource, BaseService) {
+            var b2bUrl = BaseService.getB2bUrl();
+            return $resource(b2bUrl + '/product/baseInfo/addtoCart', {}, {
+                save: {
+                    method: 'POST',
+                    isArray: false,
+                    headers: {
+                        'Content-Type' : 'application/json;charset=UTF-8'
+                    }
+                },
+            })
+        }])
+        .factory('B2bNewPurcOrder', ['$resource', 'BaseService', function($resource, BaseService) {
+            var b2bUrl = BaseService.getB2bUrl();
+            return $resource(b2bUrl + '/product/baseInfo/newPurcOrder', {}, {
+                save: {
+                    method: 'POST',
+                    isArray: false,
+                    headers: {
+                        'Content-Type' : 'application/text;charset=UTF-8'
+                    }
+                },
+                method: {
+                    url: b2bUrl + '/paymethod/method',
+                    method: 'GET'
+                }
+            })
+        }])
+        .factory('B2bCartOperation', ['$resource', 'BaseService', function($resource, BaseService) {
+            var b2bUrl = BaseService.getB2bUrl();
+            return $resource(b2bUrl + '/cart', {}, {
+                addToOrder: {
+                    url: b2bUrl + '/cart/addToOrder/:id',
+                    method: 'GET'
+                },
+                deleteCart: {
+                    url: b2bUrl + '/cart/deleteCart/:id',
+                    method: 'DELETE'
+                },
+                deleteCartDetail: {
+                    url: b2bUrl + '/cart/deleteCartDetail/:id',
+                    method: 'DELETE'
+                },
+                deleteCarts: {
+                    url: b2bUrl + '/cart/deleteCarts',
+                    method: 'DELETE'
+                },
+                getCartDetail: {
+                    url: b2bUrl + '/cart/getCartDetail/:id',
+                    method: 'GET'
+                },
+                vendorInfo: {
+                    url: b2bUrl + '/cart/vendorInfo',
+                    method: 'GET',
+                    isArray: true
+                },
+                getTodoCartCount: {
+                    url: b2bUrl + '/cart/countTodo',
+                    method: 'GET'
+                }
+            })
+        }]).factory('B2bShipAddress', ['$resource', 'BaseService', function($resource, BaseService){
+        var b2bUrl = BaseService.getB2bUrl();
+        return $resource(b2bUrl + '/account/enterprise', {}, {
+            saveAddress: {
+                url: b2bUrl + '/account/enterprise/saveShipAddress',
+                method: 'POST'
+            },
+            shipAddList: {
+                url: b2bUrl + '/account/enterprise/shipAddList',
+                method: 'GET',
+                isArray: true
+            },
+            removeShipAddress: {
+                url: b2bUrl + '/account/enterprise/removeShipAddress/:id',
+                method: 'DELETE'
+            }
+        });
+    }]).factory('B2bRecentPrice', ['$resource', 'BaseService', function($resource, BaseService) {
+        var b2bUrl = BaseService.getB2bUrl();
+        return $resource(b2bUrl + '/sale/inquiry', {}, {
+            // 获取最新的已采纳的价信息
+            agreed: {
+                url: b2bUrl + '/sale/inquiry/recentPrice/:prId',
+                method: 'GET'
+            }
+        });
+    }]).factory('B2bToken', ['$resource', 'BaseService', function($resource, BaseService) {
+        var b2bUrl = BaseService.getB2bUrl();
+        return $resource(b2bUrl + '/token', {}, {
+            info: {
+                url: b2bUrl + '/token',
+                mehtod: 'GET'
+            }
+        })
     }]);
     }]);
 });
 });

+ 30 - 0
src/main/webapp/resources/js/common/controllers/b2bCommonCtrls.js

@@ -0,0 +1,30 @@
+define([ 'app/app' ], function(app) {
+    'use strict';
+    /**
+     * 新增供应商联系人
+     */
+    app.controller('AddContacCtrl', ['$scope', 'toaster', '$modalInstance', function ($scope, toaster, $modalInstance) {
+        $scope.save = function (contact) {
+            $modalInstance.close(contact);
+        };
+
+        $scope.cancel = function () {
+            $modalInstance.dismiss();
+        }
+    }]);
+    /**
+     * 编辑供应商联系人
+     */
+    app.controller('EditContacCtrl', ['$scope', 'toaster', '$modalInstance', 'contact', function ($scope, toaster, $modalInstance, contact) {
+        $scope.contact = angular.copy(contact);
+
+        $scope.save = function (contact) {
+            $modalInstance.close(contact);
+        };
+
+        $scope.cancel = function () {
+            $modalInstance.dismiss();
+        }
+    }]);
+
+});

+ 1 - 1
src/main/webapp/resources/js/common/services.js

@@ -151,7 +151,7 @@ define([ 'angular', 'common/utils', 'big'], function(angular, utils, Big) {
 					// defer.promise.then(function (resolve) {
 					// defer.promise.then(function (resolve) {
 					// 	$rootScope.b2bUrl = resolve.url;
 					// 	$rootScope.b2bUrl = resolve.url;
 					// });
 					// });
-					$rootScope.b2bUrl = this.getRootPath().indexOf('usoftmall.com') > -1 ? 'http://uas.ubtob.com' : 'http://192.168.253.12:9000/b2b-test';
+					$rootScope.b2bUrl = this.getRootPath().indexOf('usoftmall.com') > -1 ? 'http://uas.ubtob.com' : 'http://10.1.51.124:8090/platform-b2b';
 				}
 				}
 				return $rootScope.b2bUrl;
 				return $rootScope.b2bUrl;
 			}
 			}

+ 14 - 2
src/main/webapp/resources/js/usercenter/app.js

@@ -440,10 +440,22 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
 			controllerUrl: 'app/controllers/forstore/bom_detail_ctrl'
 			controllerUrl: 'app/controllers/forstore/bom_detail_ctrl'
 		})).state('purc_vendor', angularAMD.route({
 		})).state('purc_vendor', angularAMD.route({
 			url: "/purc/vendor",
 			url: "/purc/vendor",
-			templateUrl: "static/view/usercenter/b2b/vendor/vendor.html",
+			templateUrl: "static/view/usercenter/b2b/Purc/vendor.html",
 			controller: 'PurcVendorCtrl',
 			controller: 'PurcVendorCtrl',
-			controllerUrl: 'app/controllers/b2b/vendor/PurcVendorCtrl'
+			controllerUrl: 'app/controllers/b2b/Purc/PurcVendorCtrl'
 			/* 采购供应商资料 详情*/
 			/* 采购供应商资料 详情*/
+		})).state('purc_vendordetail', angularAMD.route({
+			url: "/purc/vendor/:id",
+			templateUrl: "static/view/usercenter/b2b/Purc/vendor_detail.html",
+			controller: 'PurcVendorDetailCtrl',
+			controllerUrl: 'app/controllers/b2b/Purc/PurcVendorDetailCtrl'
+			/* 客户指定招标列表 */
+		})).state('purc_newOrder', angularAMD.route({
+			/*新增采购单*/
+			url: "/purc/addOrder",
+			templateUrl: "static/view/usercenter/b2b/Purc/addOrder.html",
+			controller: 'PurcNewOrderCtrl',
+			controllerUrl: 'app/controllers/b2b/Purc/PurcNewOrderCtrl'
 		}));
 		}));
 	}]);
 	}]);
 
 

+ 397 - 0
src/main/webapp/resources/js/usercenter/controllers/b2b/Purc/PurcNewOrderCtrl.js

@@ -0,0 +1,397 @@
+define(['app/app'], function(app) {
+    /**
+     * 新增采购单
+     */
+    app.register.controller('PurcNewOrderCtrl', ['$scope', '$modal', 'toaster', '$filter', 'B2bAddtoCart', '$rootScope', 'B2bVendorInfo', 'ngTableParams', 'BaseService', 'B2bProduct', 'B2bNewPurcOrder', 'B2bCartOperation', 'B2bShipAddress', 'B2bVendor', '$http', '$window', 'B2bToken', 'B2bRecentPrice',
+        function ($scope, $modal, toaster, $filter, addtoCart, $rootScope, VendorInfo, ngTableParams, BaseService, Product, newPurcOrder, cartOperation, ShipAddress, Vendor, $http, $window, token, recentPrice) {
+            BaseService.scrollBackToTop();
+            // 每次进入时先清除掉rootScope下的venduu
+            $rootScope.venduu = null;
+            // 获取收货地址列表
+            ShipAddress.shipAddList({}, function (data) {
+                $scope.ships = data;
+                $scope.order.shipadd = $scope.ships[0];
+            });
+
+            // 获取地址信息
+            $http.get('resources/citydata/city.json', {
+                "Accept": "application/json;charset=utf-8", "Accept-Charset": "charset=utf-8"
+            }).then(function (response) {
+                $scope.provinces = response.data;
+            });
+            var getToken = function() {
+                if($scope.token == null) {
+                    token.info({userType: 'purcorder'}, {}, function(data) {
+                        $scope.token = data.token;
+                    }, function(response) {
+                        toaster.pop('error', '提示', response.data);
+                    });
+                }
+            }
+            getToken();
+
+            $scope.order = {
+                date: new Date(),
+                vend: {
+                    uu: '',
+                },
+                vendUser: {},
+                code: $filter('date')(new Date(), 'yyMMddHHmmss_sss'),
+                orderItems: {
+                    product: {},
+                },
+                rate: 17
+            };
+
+            //商品信息
+            $scope.order.orderItems = [];
+            var item = {
+                code: null,
+                title: null,
+                spec: null,
+                unit: null,
+                qty: null,
+                price: null,
+                remark: null,
+                delivery: null,
+                prid: null,
+                taxrate: null
+            };
+
+            if ($rootScope.businessCode) {
+                VendorInfo.getVendorInfo({businessCode: $rootScope.businessCode}, {}, function (data) {
+                    $scope.id = data.id;
+                    $scope.order.vend.enName = data.vendorEnterprise.enName;
+                    $scope.order.vend.enAddress = data.vendorEnterprise.enAddress;
+                    $scope.order.vend.uu = data.vendorEnterprise.uu;
+                    $scope.order.paymethods = data.paymethod;
+                    $rootScope.venduu = data.vendorEnterprise.uu;
+                    Vendor.contacts({venduu: $scope.order.vend.uu}, {}, function (data) {
+                        $scope.contacts = data;
+                        $scope.order.vendor = $scope.contacts[0];
+                    });
+                }, function (response) {
+
+                });
+            }
+            ;
+
+            // 查找供应商
+            $scope.dbfindVend = function () {
+                var modalInstance = $modal.open({
+                    templateUrl: 'static/tpl/index/purc/modal/purc_order_vendor.html',
+                    controller: 'DbfindVendorInfoCtrl',
+                    size: 'lg',
+                    resolve: {
+                        orderItems: function () {
+                            return $scope.order.orderItems;
+                        }
+                    }
+                });
+
+                modalInstance.result.then(function (data) {
+                    $rootScope.venduu = data.vendorEnterprise.uu;
+                    $scope.id = data.id;
+                    $scope.order.vend = data.vendorEnterprise;
+                    $scope.order.vend.enName = data.vendorEnterprise.enName;
+                    $scope.order.vendUser = data.vendorUser;
+                    $scope.order.payments = data.paymethod;
+                    $scope.order.orderItems = [];
+                    var item = {
+                        code: null,
+                        title: null,
+                        spec: null,
+                        unit: null,
+                        qty: null,
+                        price: null,
+                        remark: null,
+                        delivery: null,
+                        taxrate: null
+                    };
+                    Vendor.contacts({venduu: $scope.order.vend.uu}, {}, function (data) {
+                        $scope.contacts = data;
+                        $scope.order.vendor = $scope.contacts[0];
+                    });
+
+                }, function () {
+
+                });
+            };
+
+            // 联想词 start
+            // 获取供应商
+            $scope.getSimilarVendors = function (value) {
+                if (value) {
+                    return Vendor.getSimilarVendors({keyword: value}).$promise.then(function (data) {
+                        return data.map(function (item) {
+                            return item;
+                        });
+                    });
+                }
+            };
+
+            $scope.onAssociateCmpClick = function (vendor, order) {
+                $scope.order.vend.uu = vendor.venduu;
+                $scope.id = vendor.id;
+                $scope.order.payments = vendor.paymethod;
+                $rootScope.venduu = $scope.order.vend.uu;
+                Vendor.contacts({venduu: $scope.order.vend.uu}, {}, function (data) {
+                    $scope.contacts = data;
+                    $scope.order.vendor = $scope.contacts[0];
+                });
+            }
+            // 联想词 end
+
+//		$scope.order.orderItems.push(item);
+            if ($rootScope.prodId) {
+                VendorInfo.getProdInfo({id: $rootScope.prodId}, {}, function (data) {
+                    item.code = data.code;
+                    item.title = data.title;
+                    item.spec = data.spec;
+                    item.unit = data.unit;
+                    item.id = data.id;
+                    $scope.order.orderItems.push(item);
+                    $rootScope.prodId = null;// 清除掉prodId
+                }, function (response) {
+
+                });
+            }
+            //增加商品
+            $scope.addProduct = function (index) {
+                if ($scope.order.orderItems[index].code == null) {
+                    toaster.pop('info', '提示', '请先选择商品');
+                } else {
+                    $scope.order.orderItems.push({
+                        code: null,
+                        title: null,
+                        spec: null,
+                        unit: null,
+                        qty: null,
+                        price: null,
+                        remark: null,
+                        delivery: null,
+                        $endDateOpen: false,
+                        taxrate: $scope.order.rate,
+                        prodsource: 'seller'
+                    });
+                }
+            };
+            //删除商品
+            $scope.deleteProduct = function (index) {
+                $scope.order.orderItems.splice(index, 1);
+            };
+
+            // 搜索框回车
+            $scope.onSearch = function (keyword) {
+                $scope.keyword = keyword;
+                $scope.tableParams.page(1);
+                $scope.tableParams.reload();
+            };
+
+            $scope.tableParams = new ngTableParams({
+                page: 1,
+                count: 20
+            }, {
+                total: 0,
+                counts: [5, 10, 25, 50],
+                getData: function ($defer, params) {
+                    $scope.loading = true;
+                    var pageParams = params.url();
+                    pageParams.keyword = $scope.keyword;
+                    $scope.tip = $scope.keyword;
+                    pageParams.vendUU = $scope.order.vend.uu;
+                    Product.vendPord.call(null, BaseService.parseParams(pageParams), function (page) {
+                        $scope.loading = false;
+                        if (page) {
+                            params.total(page.totalElement);
+                            $scope.total = page.totalElement;
+                            $defer.resolve(page.content);
+                        }
+                    }, function (response) {
+                        $scope.loading = false;
+                        toaster.pop('error', '数据加载失败', response.data);
+                    });
+                }
+            });
+
+
+            // 选择
+            $scope.check = function (data) {
+                var price = null;
+                var qty = null;
+                var taxRate = null;
+                if (data.id) {
+                    recentPrice.agreed({prId: data.id}, {}, function(response) {
+                        price = response.price;
+                        qty = response.qty;
+                        taxRate = response.taxRate;
+                        $scope.order.orderItems.push({
+                            code: data.code,
+                            title: data.title,
+                            spec: data.spec,
+                            unit: data.unit,
+                            qty: qty,
+                            price: price,
+                            remark: null,
+                            delivery: null,
+                            prid: data.id,
+                            taxrate: taxRate,
+                            prodsource: 'seller',
+                        });
+                    });
+                }
+            };
+
+            // 导入商品信息
+            $scope.uplodaByBatch = function () {
+                var modalInstance = $modal.open({
+                    templateUrl: 'static/tpl/index/purc/modal/purc_uplodaByBatch.html',
+                    controller: 'PurcUploadByBatchCtrl',
+                    size: 'lg',
+                    resolve: {}
+                });
+
+                modalInstance.result.then(function (data) {
+                    angular.forEach(data, function (prod) {
+                        $scope.order.orderItems.push({
+                            code: prod.code,
+                            title: prod.title,
+                            unit: 'PCS',
+                            spec: prod.spec,
+                            qty: prod.amount,
+                            price: prod.rateprice,
+                            remark: prod.remark,
+                            delivery: prod.date,
+                            prid: prod.id,
+                            taxrate: prod.rate,
+                            prodsource: 'purchaser'
+                        });
+                    })
+                }, function () {
+
+                });
+            };
+            // 监听venduu发生变化,重新加载物料信息
+            $scope.$watch('order.vend.uu', function (n, o) {
+                if (n == o) {
+                    return;
+                } else {
+                    $scope.tableParams.page(1);
+                    $scope.tableParams.reload();
+                }
+            }, true);
+
+            $scope.getMinDate = function (item) {
+                return $filter('date')(new Date, 'yyyy-MM-dd');
+            };
+
+            $scope.openDatePicker = function ($event, openParam, index) {
+                $event.preventDefault();
+                $event.stopPropagation();
+                $scope.order.orderItems[index].$endDateOpen = !openParam;
+            };
+
+
+            // 添加到购物车
+            $scope.addToCart = function (order) {
+                $scope.loading = true;
+                $scope.order.status = 311;
+                $scope.order.vendusertel = order.vendor.tel;
+                $scope.order.venduser = order.vendor.venduser;
+                $scope.order.shipaddress = order.shipadd.address + order.shipadd.addressdet + '' + order.shipadd.receiver + '' + order.shipadd.usertel;
+                $scope.order.vendUU = $scope.order.vend.uu;
+                $scope.order.vendUserUU = $scope.order.vendUser.userUU;
+                if ($scope.order.date instanceof Date) {
+                    $scope.order.date = $scope.order.date.getTime();
+                }
+                for (var i = 0; i < $scope.order.orderItems.length; i++) {
+                    if ($scope.order.orderItems[i].delivery instanceof Date) {
+                        $scope.order.orderItems[i].delivery = $scope.order.orderItems[i].delivery.getTime();
+                    }
+                    if ($scope.order.currency != 'RMB') {
+                        $scope.order.orderItems[i].rate = 0;
+                    }
+                }
+                addtoCart.save({token: $scope.token}, $scope.order, function (data) {
+                    $scope.loading = false;
+                    toaster.pop('success', '成功', '保存成功');
+                    window.location.hash = '#/purc/cart/' + data.id;
+                    $window.location.reload();
+                }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '保存失败', response.data);
+                });
+            };
+
+            // 立即购买
+            $scope.addToOrder = function (order) {
+                $scope.loading = true;
+                $scope.order.status = 200;
+                $scope.order.vendusertel = order.vendor.tel;
+                $scope.order.venduser = order.vendor.venduser + '' + order.vendor.tel;
+                $scope.order.shipaddress = order.shipadd.address + order.shipadd.addressdet + '' + order.shipadd.receiver + '' + order.shipadd.usertel;
+                $scope.order.vendUU = $scope.order.vend.uu;
+                $scope.order.vendUserUU = $scope.order.vendUser.userUU;
+                if ($scope.order.date instanceof Date) {
+                    $scope.order.date = $scope.order.date.getTime();
+                }
+                for (var i = 0; i < $scope.order.orderItems.length; i++) {
+                    if ($scope.order.orderItems[i].delivery instanceof Date) {
+                        $scope.order.orderItems[i].delivery = $scope.order.orderItems[i].delivery.getTime();
+                    }
+                    if ($scope.order.currency != 'RMB') {
+                        $scope.order.orderItems[i].rate = 0;
+                    }
+                }
+                addtoCart.save({token: $scope.token}, $scope.order, function (data) {
+                    $scope.loading = false;
+                    toaster.pop('success', '成功', '保存成功');
+                    window.location.hash = '#/purc/order/' + data.id;
+                }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '保存失败', response.data);
+                });
+            };
+
+            // 新增收货地址保存
+            $scope.saveShipAddress = function (ship) {
+                ship.address = ship.province + ship.city + ship.district;
+                ShipAddress.saveAddress({}, ship, function (data) {
+                    if (data.success) {
+                        ShipAddress.shipAddList({}, function (data) {
+                            $scope.ships = data;
+                            $scope.order.shipadd = $scope.ships[0];
+                        });
+                        toaster.pop('success', '提示', data.success);
+                    }
+                    if (data.error) {
+                        toaster.pop('error', '提示', data.error);
+                    }
+                });
+            }
+
+            // 新增供应商联系人
+            $scope.addContact = function (uu) {
+                var modalInstance = $modal.open({
+                    animation: true,
+                    templateUrl: 'static/tpl/index/purc/modal/contact_person_modal.html',
+                    controller: 'AddContacCtrl',
+                    resolve: {}
+                });
+                modalInstance.result.then(function (data) {
+                    $scope.contact = data;
+                    $scope.contact.venduu = uu;
+                    Vendor.saveContact({}, $scope.contact, function (data) {
+                        Vendor.contacts({venduu: $scope.order.vend.uu}, {}, function (data) {
+                            $scope.contacts = data;
+                            $scope.order.vendor = $scope.contacts[0];
+                        });
+                        toaster.pop('success', '提示', '联系人保存成功');
+                    }, function (response) {
+                        toaster.pop('error', '失败', response.data);
+                    });
+                });
+            }
+
+        }]);
+});

+ 0 - 0
src/main/webapp/resources/js/usercenter/controllers/b2b/vendor/PurcVendorCtrl.js → src/main/webapp/resources/js/usercenter/controllers/b2b/Purc/PurcVendorCtrl.js


+ 134 - 0
src/main/webapp/resources/js/usercenter/controllers/b2b/Purc/PurcVendorDetailCtrl.js

@@ -0,0 +1,134 @@
+define(['app/app'], function(app) {
+    /**
+     * 供应商详情
+     */
+    app.register.controller('PurcVendorDetailCtrl', ['$scope', 'toaster', '$stateParams', 'B2bVendor', '$modal', 'B2bProduct', 'ngTableParams', 'BaseService', '$rootScope', function ($scope, toaster, $stateParams, Vendor, $modal, Product, ngTableParams, BaseService, $rootScope) {
+        BaseService.scrollBackToTop();
+        $scope.vendorContacts = [];
+        var loadData = function () {
+            Vendor.getVendorDetail({id: $stateParams.id}, {}, function (data) {
+                $scope.vendor = data.vendorEnterprise;
+                Vendor.contacts({venduu: $scope.vendor.uu}, {}, function (data) {
+                    $scope.vendorContacts = data;
+                });
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            });
+        };
+        loadData();
+
+        // 新增供应商联系人
+        $scope.addContact = function (uu) {
+            var modalInstance = $modal.open({
+                animation: true,
+                templateUrl: 'static/view/vendor/b2b/modal/contact_person_modal.html',
+                controller: 'AddContacCtrl',
+                resolve: {}
+            });
+            modalInstance.result.then(function (data) {
+                $scope.contact = data;
+                $scope.contact.venduu = uu;
+                Vendor.saveContact({}, $scope.contact, function (data) {
+                    toaster.pop('success', '提示', '联系人保存成功');
+                    $scope.vendorContacts.push(data);
+                }, function (response) {
+                    toaster.pop('error', '失败', response.data);
+                });
+            });
+        };
+
+        // 编辑供应商联系人
+        $scope.edit = function (contact) {
+            var modalInstance = $modal.open({
+                animation: true,
+                templateUrl: 'static/view/vendor/b2b/modal/contact_person_modal.html',
+                controller: 'EditContacCtrl',
+                resolve: {
+                    contact: function () {
+                        return contact;
+                    }
+                }
+            });
+            modalInstance.result.then(function (data) {
+                Vendor.saveContact({}, data, function (data) {
+                    loadData();
+                    toaster.pop('success', '提示', '联系人修改成功');
+                }, function (response) {
+                    toaster.pop('error', '失败', response.data);
+                });
+            });
+        }
+
+        // 删除供应商联系人
+        $scope.deleteById = function (id, index) {
+            $scope.vendorContacts.splice(index, 1);
+            Vendor.deleteContact({id: id}, {}, function (data) {
+                toaster.pop('success', '提示', '供应商联系人删除成功');
+                loadData();
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            });
+        }
+
+        // 供应商物料信息
+        $scope.viewProdList = function (uu) {
+            $scope.uu = uu;
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+
+        // 搜索框回车
+        $scope.onSearch = function (keyword) {
+            $scope.keyword = keyword;
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+
+        // 供应商物料信息
+        $scope.tableParams = new ngTableParams({
+            page: 1,
+            count: 20
+        }, {
+            total: 0,
+            counts: [5, 10, 25, 50],
+            getData: function ($defer, params) {
+                $scope.loading = true;
+                var pageParams = params.url();
+                pageParams.custUU = $scope.uu;
+                pageParams.keyword = $scope.keyword;
+                $scope.tip = $scope.keyword;
+                Product.get.call(null, BaseService.parseParams(pageParams), function (page) {
+                    $scope.loading = false;
+                    if (page) {
+                        params.total(page.totalElement);
+                        $scope.total = page.totalElement;
+                        $defer.resolve(page.content);
+                        $scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
+                    }
+                }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '数据加载失败', response.data);
+                });
+            }
+        });
+
+        /**
+         * 选中单个物料购买
+         * @param businessCode
+         * @param id
+         */
+        $scope.PurcByEnAndProd = function (businessCode, id) {
+            $rootScope.businessCode = businessCode;
+            $rootScope.prodId = id;
+            window.location.hash = "#/purc/addOrder";
+        }
+
+        /**
+         * 询价
+         */
+        $scope.PurcInquiry = function (businessCode, id) {
+            $rootScope.prodId = id;
+            window.location.hash = "#/purc/purcinquiry/" + businessCode;
+        }
+    }]);
+});

+ 1 - 1
src/main/webapp/resources/js/usercenter/main.js

@@ -75,6 +75,6 @@ require.config({
     }
     }
 	}
 	}
 });
 });
-require([ 'app/app', 'common/controllers/commonCtrls', 'common/controllers/GoodsPickUpCtrl' ], function(app) {
+require([ 'app/app', 'common/controllers/commonCtrls', 'common/controllers/b2bCommonCtrls', 'common/controllers/GoodsPickUpCtrl' ], function(app) {
 	app.init();
 	app.init();
 });
 });

+ 0 - 27
src/main/webapp/resources/js/vendor/controllers/b2b/sale/saleCustomerDetailCtrl.js

@@ -185,33 +185,6 @@ define(['app/app'], function (app) {
         }
         }
     }]);
     }]);
 
 
-    /**
-     * 新增供应商联系人
-     */
-    app.register.controller('AddContacCtrl', ['$scope', 'toaster', '$modalInstance', function ($scope, toaster, $modalInstance) {
-        $scope.save = function (contact) {
-            $modalInstance.close(contact);
-        };
-
-        $scope.cancel = function () {
-            $modalInstance.dismiss();
-        }
-    }]);
-    /**
-     * 编辑供应商联系人
-     */
-    app.register.controller('EditContacCtrl', ['$scope', 'toaster', '$modalInstance', 'contact', function ($scope, toaster, $modalInstance, contact) {
-        $scope.contact = angular.copy(contact);
-
-        $scope.save = function (contact) {
-            $modalInstance.close(contact);
-        };
-
-        $scope.cancel = function () {
-            $modalInstance.dismiss();
-        }
-    }]);
-
     app.register.controller('AddUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'B2bAccountUser', 'toaster', function ($scope, $modalInstance, customer, AccountUser, toaster) {
     app.register.controller('AddUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'B2bAccountUser', 'toaster', function ($scope, $modalInstance, customer, AccountUser, toaster) {
         $scope.checkboxes = {
         $scope.checkboxes = {
             checked: false
             checked: false

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

@@ -68,6 +68,6 @@ require.config({
 		'big' : ['jquery']
 		'big' : ['jquery']
 	}
 	}
 });
 });
-require([ 'app/app', 'common/controllers/commonCtrls' ], function(app) {
+require([ 'app/app', 'common/controllers/commonCtrls', 'common/controllers/b2bCommonCtrls' ], function(app) {
 	app.init();
 	app.init();
 });
 });

+ 445 - 0
src/main/webapp/resources/view/usercenter/b2b/Purc/addOrder.html

@@ -0,0 +1,445 @@
+<style>
+	#pub .purc li div span .select02 {
+		background: none;
+		-webkit-appearance: inherit;
+		appearance: inherit;
+		-o-appearance: inherit;
+		-moz-appearance: inherit;
+		-ms-appearance: inherit;
+		border: #bfbfbf 1px solid !important;
+		width: 187px;
+	}
+
+	.dropdown-menu tr td button {
+		border: none;
+	}
+
+	.oder-change .purc li .dropdown-menu {
+		padding: 0;
+		margin: 0;
+		width: 185px;
+	}
+
+	.oder-change .purc li .dropdown-menu li {
+		margin-bottom: 0;
+		height: 34px;
+		line-height: 34px;
+	}
+
+	.oder-change .purc li  .dropdown-menu>li>a {
+		display: inline-block;
+		width: 100%;
+		padding: 0;
+		height: 34px;
+		line-height: 34px;
+		padding-left: 10px;
+	}
+
+	.dropdown-menu>.active>a, .dropdown-menu>.active>a:hover, .dropdown-menu>.active>a:focus
+	{
+		background: #5078cb;
+	}
+
+	.com_title01 a {
+		float: right;
+		color: #5078cb;
+		font-weight: normal;
+		margin-right: 30px;
+		margin-top: 20px;
+		font-size: 14px;
+	}
+</style>
+<div class="wrap" id="pub">
+	<div class="content">
+		<!--<div class="com_title">服务>采购模块>采购单<font>>新增采购单</font></div>-->
+		<div class="com_head">
+			<span>新增采购单</span>
+		</div>
+		<!--B2B商务采购变更-添加-->
+		<form class="oder-change clearfix" name="orderForm" id="orderForm">
+			<ul class="purc">
+				<li>
+					<div class="fl">
+						<em>流水号:</em> <span>{{::order.code}}</span>
+					</div>
+					<div class="fr">
+						<em>录入时间:</em> <span>{{::order.date | date:'yyyy-MM-dd HH:mm:ss'}}</span>
+					</div>
+				</li>
+				<li>
+					<div class="fl">
+						<em>供应商:</em> <span><input type="text"
+												   ng-model="order.vend.enName" placeholder="输入供应商名称" class="bor01"
+												   ng-required="true"
+												   ng-change="getSimilarVendors(order.vend.enName)" name="enName"
+												   ng-focus="onFocus('enName')"
+												   typeahead="order.vendName for order in getSimilarVendors($viewValue)"
+												   autocomplete="off"
+												   typeahead-on-select="onAssociateCmpClick($item, order)"
+												   spellcheck="false" style="width: 147px;"> <a class="btn"
+																								ng-click="dbfindVend()"
+																								style="width: 40px; border: #bfbfbf 1px solid !important; border-radius: 0px; margin-left: -5px; margin-top: -3px;"><i
+							class="fa fa-search" aria-hidden="true"></i></a> </span>
+					</div>
+					<div class="fr">
+						<em>供应商联系人:</em> <span> <select class="select01"
+														ng-model="order.vendor" required="required"
+														ng-options="(contact.venduser + '' + contact.tel) for contact in contacts">
+									<option value="">请选择供应商联系人</option>
+							</select> <a class="add-address" ng-if="id!=null"
+										 ng-click="addContact(venduu)">+增加联系人</a>
+							</span>
+					</div>
+				</li>
+				<li>
+					<div class="fl">
+						<em>付款方式:</em> <span> <input ng-model="order.payments"
+													 list="paymentmethod" class="select02 wid152"
+													 placeholder="选择付款方式" /> <datalist id="paymentmethod">
+									<option value="月结30天">月结30天</option>
+									<option value="月结60天">月结60天</option>
+									<option value="现金支付">现金支付</option>
+								</datalist>
+							</span>
+					</div>
+					<div class="fr">
+						<em>交易币别:</em> <span> <select name=""
+													  class="select02 wid100" ng-model="order.currency"
+													  ng-init="order.currency = 'RMB'">
+									<option value="RMB">RMB</option>
+									<option value="USD">USD</option>
+									<option value="HKD">HKD</option>
+							</select>
+							</span>
+					</div>
+				</li>
+				<li>
+					<div class="fr address">
+						<em>收货信息:</em> <span class="fr" required="required"> <select
+							class="select fl" ng-model="order.shipadd" required="required"
+							ng-options="(ship.address + ship.addressdet + ' ' + ship.receiver + ' ' + ship.usertel) for ship in ships">
+									<option value="">请选择收货地址</option>
+							</select> <a href="javascript:void(0);" class="add-address"><i class="fa fa-plus-square fa-fw"></i>新增收货信息</a>
+							</span>
+					</div>
+				</li>
+				<li class="beizhu">
+					<div class="fl">
+						<em>备注:</em> <span><input type="text"
+												  ng-model="order.remark" class="bor01" placeholder="请填写备注"
+												  style="cursor: pointer; width: 568px;" /></span>
+					</div>
+				</li>
+				<li ng-show="false">
+					<div class="fl">
+						<em>税率:</em> <span class="fl" required="required"
+										   ng-if="order.currency == 'RMB'"> <select
+							class="select02 wid100" ng-model="order.rate"
+							required="required">
+									<option value="17">17</option>
+									<option value="0">0</option>
+							</select>
+							</span> <span class="fl" required="required"
+										  ng-if="order.currency != 'RMB'"> <input
+							class="text select02 wid100" value="0" readonly>
+							</span>
+					</div>
+				</li>
+			</ul>
+			<div class="com_title01"
+				 ng-if="order.orderItems[0].code == null && !order.vend.uu">
+				<span>请先选择供应商</span>
+			</div>
+			<div class="com_title01"
+				 ng-if="order.orderItems[0].code == null && order.vend.uu">
+				<span>请先选择供应商产品</span> <a ng-click="uplodaByBatch()">批量导入</a>
+			</div>
+			<div class="com_title01"
+				 ng-if="order.orderItems[0].code != null && order.vend.uu">
+				<span>产品信息</span> <a ng-click="uplodaByBatch()">批量导入</a>
+			</div>
+			<!--产品信息-->
+			<dl ng-if="order.orderItems[0].code != null">
+				<dt>
+					<b>序号</b> <b class="wid01">产品信息</b> <b>单位</b> <b>数量</b> <b>单价</b>
+					<b>税率(%)</b> <b>交货日期</b> <b>备注</b> <b class="wid02">&nbsp;</b>
+				</dt>
+				<dd ng-repeat="item in order.orderItems">
+					<b>{{$index + 1}}</b>
+					<b class="wid01">
+						<p>{{::item.code}}</p>
+						<p>{{::item.title}}</p>
+						<p>{{::item.spec}}</p>
+					</b> <b>{{::item.unit||'-'}}</b>
+					<b><input class="editable" type="text"
+							  ng-model="item.qty" placeholder="数量" style="cursor: pointer;"
+							  required="true"
+							  ng-pattern="/^(([0-9]+\.[0-9]{1,3})|([0-9]*[1-9][0-9]*\.[0-9]{1,3})|([0-9]*[1-9][0-9]*))$/" />
+					</b>
+					<b><input class="editable" type="text" ng-model="item.price"
+							  placeholder="单价" style="cursor: pointer;" required="true"
+							  ng-pattern="/^(([0-9]+\.[0-9]{1,6})|([0-9]*[1-9][0-9]*\.[0-9]{1,6})|([0-9]*[1-9][0-9]*))$/" />
+					</b>
+					<b ng-if="order.currency == 'RMB'">
+						<input class="editable" type="text" ng-model="item.taxrate" placeholder="税率"
+							   style="cursor: pointer;" ng-pattern="/^[0-9][0-9]{0,1}$/" />
+					</b>
+					<b ng-if="order.currency != 'RMB'">
+						<input class="editable" type="text" style="cursor: pointer;" value="0" readonly="readonly" />
+					</b>
+					<b> <input ng-model="item.delivery"
+							   type="text" class="editable" placeholder="选择时间"
+							   datepicker-popup="yyyy-MM-dd" is-open="item.$endDateOpen"
+							   min-date="getMinDate()" ng-required="true" current-text="今天"
+							   clear-text="清除" close-text="关闭"
+							   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+							   ng-focus="openDatePicker($event, item.$endDateOpen)"
+							   readonly="readonly"
+							   ng-click="openDatePicker($event, item.$endDateOpen, $index)">
+					</b>
+					<b class="textMore">
+						<input class="editable" type="text" ng-model="item.remark" placeholder="备注" />
+					</b>
+					<b class="wid02">
+						<a ng-click="deleteProduct($index)"><i class="fa fa-close"></i></a>
+					</b>
+				</dd>
+			</dl>
+			<div class="save" ng-if="order.orderItems[0].code != null">
+				<button ng-click="addToOrder(order)"
+						ng-disabled="orderForm.$invalid">立即购买</button>
+				<button ng-click="addToCart(order)"
+						ng-disabled="orderForm.$invalid">添加购物车</button>
+			</div>
+		</form>
+		<!-- 搜索结果列表-->
+		<div class="pro-add-data02" style="min-height: 500px;"
+			 ng-if="order.vend.uu">
+			<div class="pro-search">
+				<div class="col-xs-2 search-title fl">供应商产品库</div>
+				<div class="col-xs-8 fr">
+					<div class="col-xs-9 search" style="margin-right: 0;">
+						<input type="text" placeholder="输入供应商物料关键字查询" ng-model="keyword"
+							   ng-search="onSearch(keyword)" /> <a class="seek"
+																   ng-click="onSearch(keyword)" style="right: inherit;">搜索</a>
+					</div>
+					<div class="col-xs-3 result-title fr">
+						搜索到<em>{{total}}</em>条
+					</div>
+				</div>
+			</div>
+			<table class="block table table-default table-striped"
+				   ng-table="tableParams">
+				<thead>
+				<tr class="header">
+					<th width="250">名称</th>
+					<th width="160">编号</th>
+					<th>规格</th>
+					<th width="80">单位</th>
+					<th width="80">选择</th>
+				</tr>
+				</thead>
+				<tbody ng-if="loading">
+				<tr>
+					<td colspan="5">
+						<div class="text-center">
+							<img src="static/img/all/loading.gif">
+						</div>
+					</td>
+				</tr>
+				</tbody>
+				<tbody ng-if="!loading && tableParams.total() == 0">
+				<tr>
+					<td colspan="5">
+						<div id="empty">
+							<div class="left_img">
+								<a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
+								<a href="#/index" title="B2B商务首页">B2B 商务</a>
+							</div>
+							<div class="right_link">
+								<p ng-if="tip != null">搜索"{{tip}}"未找到产品信息,请重新输入搜索条件</p>
+								<p ng-if="tip == null">您的供应商还未添加商品信息,请尽快通知供应商</p>
+							</div>
+						</div>
+					</td>
+				</tr>
+				</tbody>
+				<tbody>
+				<tr ng-repeat="product in $data">
+					<td class="text-center" ng-bind="::product.title"></td>
+					<td class="text-center" ng-bind="::product.code"></td>
+					<td class="text-center f12" ng-bind="::product.spec"></td>
+					<td class="text-center" ng-bind="::product.unit"></td>
+					<td class="text-center"><a title="添加"
+											   href="javascript:void(0)" ng-click="check(product)"
+											   style="text-decoration: none; color: #3f84f6;" id="click"
+											   class="add01">添加</a>
+						<div class="add-tanchuang">
+							<ul>
+								<li>
+									<div class="fl">数量:</div>
+									<div class="fr">
+										<div class="btn-wrap">
+													<span class="number"> <a href="###" class="reduce">-</a>
+														<input type="text" value="100"> <a href="###"
+																						   class="add">+</a>
+													</span>
+										</div>
+									</div>
+								</li>
+								<li>
+									<div class="fl">交期:</div>
+									<div class="fr">
+										<input type="text" class="price-input" value="时间选择">
+									</div>
+								</li>
+								<li>
+									<div class="fl">单价:</div>
+									<div class="fr">
+										<input type="text" class="price-input" value="¥1.23">
+									</div>
+								</li>
+								<li class="add-btn">
+									<div class="fl">&nbsp;</div>
+									<div class="fr">
+										<a href="javascript:void(0);" class="off">取消</a><a
+											href="javascript:void(0);" class="ok">确认</a>
+									</div>
+								</li>
+							</ul>
+						</div></td>
+				</tr>
+				</tbody>
+			</table>
+		</div>
+	</div>
+</div>
+<!--设置-企业设置-收货地址编辑-->
+<div class="bomb-box" style="display: none">
+	<form class="box04 box" name="shipAddress" id="shipAddress">
+		<i class="off"><img src="static/img/purc/close.png" alt="" /></i>
+		<p>收货人资料</p>
+		<ul>
+			<li class="line01">
+				<div class="fl">
+						<span class="fl"><em>*</em>收货人:
+						</span> <span class="fr"><input type="text" placeholder="填写收货人"
+														ng-model="ship.receiver" required="true"
+														ng-pattern="/^[\u4e00-\u9fa5]{1,6}$|^[\dA-Za-z]{1,12}$/" /></span>
+				</div>
+				<div class="fr">
+						<span class="fl"><em>*</em>手机:
+						</span> <span class="fr"><input type="text"
+														ng-model="ship.usertel" required="true"
+														ng-pattern="/^1(3|4|5|7|8)\d{9}$/" /></span>
+				</div>
+			</li>
+			<li class="line01">
+				<div class="fl">
+						<span class="fl">固定电话<em></em>:
+						</span> <span class="fr"><input type="text" ng-model="ship.phone"
+														ng-pattern="/([0-9]{3,4}-)?[0-9]{7,8}/" /></span>
+				</div>
+				<div class="fr">
+					<span class="fl">邮箱:</span> <span class="fr emaill"><input
+						type="text" ng-model="ship.email"
+						ng-pattern="/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/" /><i>用于接收订单提醒邮件,便于您及时了解订单状态</i></span>
+				</div>
+			</li>
+			<li class="line02 margin-top40">
+				<div class="fl">
+					<em>*</em>所在地址:
+				</div> <!--<div class="select fr"><input type="text" placeholder="请选择" ng-model="ship.address" required="true"/><i class="fa fa-angle-down"></i></div>-->
+				<div class="select fr">
+					<select required="" class="area-select" ng-model="ship.province"
+							ng-options="key as key for (key,value) in provinces"
+							ng-change="ship.city='';ship.district='';" required="true">
+						<option value="">省</option>
+					</select> <select class="area-select" ng-model="ship.city"
+									  ng-options="key as key for (key,value) in provinces[ship.province]"
+									  ng-change="ship.district='';" required="true">
+					<option value="">市</option>
+				</select> <select class="area-select" ng-model="ship.district"
+								  ng-options="value as value for value in provinces[ship.province][ship.city]"
+								  required="true">
+					<option value="">区</option>
+				</select>
+				</div>
+			</li>
+			<li class="line02">
+				<div class="fl">
+					<em>*</em>详细地址:
+				</div>
+				<div class="fr">
+					<input type="text" ng-model="ship.addressdet" required="true" />
+				</div>
+			</li>
+			<li class="line02">
+				<div class="fl">地址别名:</div>
+				<div class="fr address">
+					<input type="text" ng-model="ship.addalias" /><i>建议填写常用名称:家里/父母家/公司</i>
+				</div>
+			</li>
+		</ul>
+		<div class="many-file-btn">
+			<button class="btn01" ng-click="saveShipAddress(ship)"
+					ng-disabled="shipAddress.$invalid">保存</button>
+			<a href="#" class="btn02">取消</a>
+		</div>
+	</form>
+</div>
+<script src="static/lib/jquery/jquery.min.js"></script>
+<script>
+	$(function(){
+		/*下拉效果*/
+		$('.select p').click(function(e){
+			$('.select').toggleClass('open');
+			e.stopPropagation();
+		});
+		$('.select ul li').click(function(e){
+			var title=$(this).html();
+			$('.select p').html(title);
+			$(this).addClass('selected').siblings().removeClass('selected');
+			$('.select').removeClass('open');
+			e.stopPropagation();
+		});
+		$(document).click(function(){
+			$('.select').removeClass('open');
+		})
+		/*鼠标移动上去删除*/
+		$('.oder-change dl dd').hover(function(){
+			$(this).find('a').toggle();
+		});
+		/*点击添加弹出框*/
+		$(".pro-add-data02 .add01").click(function(){
+			$(".add-tanchuang").show();
+			$(this).parents("dd").addClass("active").siblings().removeClass("active");
+		});
+		$(".add-tanchuang a.off").click(function(){
+			$(this).parents(".add-tanchuang").hide();
+			$(this).parents(".pro-add-data02").find("dd").removeClass("active");
+		});
+		//增加数量
+		$(document).on('click','.add-tanchuang .btn-wrap span.number a.add',function () {
+			var sum = parseInt($(this).prev().val())+1;
+			$(this).prev().val(sum)
+		});
+		//减少数量
+		$(document).on('click','.add-tanchuang .btn-wrap span.number a.reduce',function () {
+			var sum = parseInt($(this).next().val())-1;
+			$(this).next().val(sum);
+		});
+		//新增收货地址
+		$(".oder-change ul li .add-address").click(function(){
+			document.getElementById('shipAddress').reset();
+			$(".bomb-box").show();
+		});
+		$(".bomb-box .box04 .off,.box04 .many-file-btn .btn02").click(function(){
+			$(".bomb-box").hide();
+		})
+		$(".bomb-box .box04 .off,.box04 .many-file-btn .btn01").click(function(){
+			$(".bomb-box").hide();
+		})
+
+	})
+</script>

+ 153 - 0
src/main/webapp/resources/view/usercenter/b2b/Purc/vendor.html

@@ -0,0 +1,153 @@
+<style>
+	.wrap-content table{
+		background-color: #fff;
+	}
+
+	.wrap-content table .table-hover {
+		border: 1px red solid;
+	}
+	#customer-tab .header th,#customer-tab tbody tr.header,#customer-tab tbody tr.header th{
+		height: 38px;
+		text-align: center;
+		padding: 0;
+		line-height: 38px;
+		border-bottom-width: 0;
+		background: #f5f5f5;
+		border: none;
+		font-size: 12px;
+	}
+	.pane-header{
+		/*border-radius: 0px 0 0px 0px;
+        box-shadow: 0 0 3px #ccc;
+        background: linear-gradient(to top, #e7e7e7 0%,#ffffff 100%);*/
+		height: 40px;
+		font-size: 14px;
+		line-height: 40px;}
+	#customer-tab .pane-body{
+		padding: 0;
+	}
+	#customer-tab tbody tr td{
+		text-align: center;
+		line-height: 24px;
+		vertical-align: inherit;
+		font-size: 14px;
+	}
+	#customer-tab .com_title{
+		margin-bottom: 10px;
+	}
+	#customer-tab tbody tr td a{
+		color: #5078cb;
+	}
+	#customer-tab tbody tr td a:hover{
+		color: #d32526 !important;
+		text-decoration: underline !important;
+	}
+	.body-wrap {
+		background: #fff;
+	}
+	.body-wrap .wrap-content {
+		padding: 10px 14px;
+	}
+	#public {
+		background: #f5f8fe;
+		height: 52px;
+		line-height: 52px;
+		padding: 0 14px;
+	}
+	#topSearch {
+		color: #333;
+		float: left;
+		font-size: 12px;
+	}
+	#topSearch span {
+		color: #999;
+	}
+	#public .fr {
+		width: 380px;
+	}
+	#public .search {
+		padding-top: 11px;
+	}
+	#public .search input {
+		width: 320px;
+		border: 1px solid #5078cb;
+	}
+	#public .search .btn {
+		border: 1px solid #5078cb;
+		background: #5078cb;
+		color: #fff;
+	}
+</style>
+<div class="user_right fr">
+	<div class="com_tab" style="margin-bottom: 10px">
+		<ul class="fl">
+			<li class="active">
+				<a>供应商资料</a>
+			</li>
+		</ul>
+	</div>
+	<div class="body-wrap">
+		<div id="public">
+			<div id="topSearch">
+				<span>搜索"{{tip}}",为您找到结果:</span>
+				单据{{total}}条
+			</div>
+			<div class="fr">
+				<div class="search">
+					<div class="input-group form-group form-group-sm has-feedback" dropdown auto-close="outsideClick" on-toggle="searchAdvance=open">
+						<input type="search" class="form-control input-sm" ng-model="keyword" ng-search="onSearch(keyword)" placeholder="输入企业名称、营业执照号、申请人或审核人"  style="width: 100%"/>
+						<a class="btn input-group-addon" ng-click="onSearch(keyword)">搜索</a>
+					</div>
+				</div>
+			</div>
+		</div>
+		<div class="wrap-content" id="customer-tab">
+			<div>
+				<!--供应商列表-->
+				<table class="table b2b-modal-table"
+					   ng-table="customerParams">
+					<thead>
+					<tr class="pane-header">
+						<th width="80" class="text-center">UU</th>
+						<th width="180" class="text-center">供应商名称</th>
+						<th width="120" class="text-center">简称</th>
+						<th width="200" class="text-center">地址</th>
+						<th width="100" class="text-center">联系人</th>
+						<th width="80" class="text-center">联系电话</th>
+						<th width="170" class="text-center">操作</th>
+					</tr>
+					</thead>
+					<tbody ng-if="$data.length === 0">
+					<tr>
+						<td colspan="7">
+							<div id="empty">
+								<div class="left_img">
+									<a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
+									<a href="#/index" title="B2B商务首页">B2B 商务</a>
+								</div>
+								<div class="right_link">
+									<p>暂无对应的供应商信息</p>
+								</div>
+							</div>
+						</td>
+					</tr>
+					</tbody>
+					<tbody>
+					<tr ng-repeat="vendor in $data">
+						<td ng-bind="::vendor.vendorEnterprise.uu"></td>
+						<td class="text-center"><a href="#/purc/vendor/{{vendor.id}}" ng-bind="::vendor.vendorEnterprise.enName" title="查看供应商资料" class="color32 order-detail"></a></td>
+						<td class="text-center" ng-bind="::vendor.vendorEnterprise.enShortname"></td>
+						<td class="text-center" ng-bind="::vendor.vendorEnterprise.enAddress"></td>
+						<td class="text-center" ng-bind="::vendor.vendorUser.userName"></td>
+						<td class="text-center" ng-bind="::vendor.vendorUser.userTel"></td>
+						<td class="text-center">
+							<a ng-click="purcByEn(vendor.vendorEnterprise.enBussinessCode)">下采购单</a><br/>
+							<a href="#/purc/purcinquiry/{{vendor.vendorEnterprise.enBussinessCode}}">立即询价</a>
+						</td>
+					</tr>
+					</tbody>
+				</table>
+			</div>
+		</div>
+	</div>
+</div>

+ 220 - 0
src/main/webapp/resources/view/usercenter/b2b/Purc/vendor_detail.html

@@ -0,0 +1,220 @@
+<style>
+    .cus-detail {
+        background: #fff;
+    }
+    .cus-detail .head {
+        background: #5078cb;
+        color: #f5f5f5;
+        height: 30px;
+        line-height: 30px;
+        padding-left: 15px;
+        font-size: 14px;
+    }
+    .cus-detail .head .head-link {
+        font-size: 14px;
+        color: #f5f5f5;
+    }
+    .cus-detail .base-block {
+        border-top: 2px solid #f5f5f5;
+        padding: 0 16px 20px;
+    }
+    .cus-detail .com_title01 {
+        padding: 21px 7px;
+        font-size: 14px;
+        color: #5078cb;
+        font-weight: bold;
+        position: relative;
+    }
+    .cus-detail .com_title01::before {
+        content: '';
+        background: #5078cb;
+        width: 3px;
+        height: 14px;
+        position: absolute;
+        left: 0;
+        top: 22px;
+    }
+    .cus-detail .com_title01 .operate {
+        float: right;
+        color: #30a603;
+        font-weight: normal;
+    }
+    .cus-detail .base-info {
+        margin: 0 16px;
+        background: #fef9f4;
+        border: 1px solid #e8e8e8;
+        border-radius: 5px;
+        padding: 0 16px;
+    }
+    .cus-detail .base-info dd {
+        font-size: 14px;
+        line-height: 30px;
+    }
+    .cus-detail .base-info .title {
+        color: #666;
+        padding-right: 25px;
+    }
+    .cus-detail .supply-list01 dl {
+        width: 100%;
+    }
+    .cus-detail .search {
+        width: 1027px;
+        margin-left: -16px;
+        margin-bottom: 15px;
+    }
+    .vendor-detail .pro-add-data .base-dl {
+        padding: 0 13px;
+        background: #fef9f4;
+        border-radius: 5px;
+    }
+    .vendor-detail .pro-add-data .base-dl dd {
+        line-height: 35px;
+        font-size: 14px;
+    }
+    .vendor-detail .pro-add-data .base-dl dd .title {
+        color: #666;
+    }
+    .vendor-detail .supply-list01 dl,
+    .vendor-detail .supply-list01 dd{
+        width: 100%;
+    }
+    .vendor-detail .supply-list01 dl span{
+        font-size: 14px;
+        float: left;
+        display: inline-block;
+        height: 38px;
+        line-height: 38px;
+        text-align: center;
+        width: 16.4% !important;
+    }
+    .vendor-detail .supply-list01 dl span.wid01{
+        width: 8% !important;
+    }
+    .vendor-detail .supply-list01 dl span.wid02{
+        width: 10% !important;
+    }
+    .vendor-detail .supply-list01 dl dt span{
+        background: #f5f8fe;
+    }
+    .vendor-detail .supply-list01 dd {
+        border-left: 1px solid #dae5fd;
+        border-right: 1px solid #dae5fd;
+        border-bottom: 1px solid #dae5fd;
+    }
+    .vendor-detail .supply-list01 dd span {
+        height: 50px;
+        line-height: 50px;
+    }
+    .vendor-detail .supply-list01 dd .edit {
+        margin-right: 5px;
+    }
+</style>
+<div class="user_right fr vendor-detail cus-detail">
+    <div class="head"><a class="head-link" href="user#/purc/vendor">供应商资料</a> > <span>供应商详情</span></div>
+    <div class="base-block">
+        <!--供应商详情-->
+        <div class="pro-add-data clearfix">
+            <div class="com_title01 sty01"><span>基本信息</span></div>
+            <dl class="base-dl">
+                <dd>
+                    <div class="title inline-block">企业名称:</div>
+                    <div class="content inline-block">{{vendor.enName}}</div>
+                </dd>
+                <dd>
+                    <div class="title inline-block">简称:</div>
+                    <div class="content inline-block">{{vendor.enShortname}}</div>
+                </dd>
+                <dd>
+                    <div class="title inline-block">地址:</div>
+                    <div class="content inline-block">{{vendor.enAddress}}</div>
+                </dd>
+                <dd>
+                    <div class="title inline-block">主营:</div>
+                    <div class="content inline-block">{{vendor.enType}}</div>
+                </dd>
+            </dl>
+            <!--客户联系人-->
+            <div class="com_title01"><span>供应商联系人</span><a class="operate" ng-click="addContact(vendor.uu)"><i class="fa fa-plus-square fa-fw"></i>新增供应商联系人</a></div>
+            <div class="supply-list01 pro-info clearfix">
+                <dl>
+                    <dt>
+                        <span>姓名</span>
+                        <span class="wid01">性别</span>
+                        <span>职务</span>
+                        <span>手机</span>
+                        <span>电话</span>
+                        <span>邮箱</span>
+                        <span class="wid02">操作</span>
+                    </dt>
+                    <dd class="clearfix" ng-repeat = "contact in vendorContacts| orderBy:'-id'">
+                        <span class="textMore">{{contact.venduser}}</span>
+                        <span class="wid01" ng-bind="contact.sex == 'F' ? '女' : '男'"></span>
+                        <span>{{contact.position}}</span>
+                        <span>{{contact.tel}}</span>
+                        <span>{{contact.phone}}</span>
+                        <span>{{contact.email}}</span>
+                        <span class="wid02"><a ng-click="edit(contact)" class="edit base-blue">编辑</a><a class=" base-blue" ng-click="deleteById(contact.id, $index)">删除</a></span>
+                    </dd>
+                    <dd class="clearfix" ng-if="vendorContacts.length == 0">
+                        <span style="width: 100% !important; color: #999;">您还未添加供应商联系人!</span>
+                    </dd>
+                </dl>
+            </div>
+            <div class="com_title01">
+                <span>查看供应商物料信息</span>
+                <a class="operate" style="color: #5078cb;" ng-click="$open=!$open;viewProdList(vendor.uu)">
+                    <em ng-bind="$open ? '收起':'展开'" class="f14">展开</em>
+                    <i class="fa fa-fw" ng-class="{'fa-angle-up': $open, 'fa-angle-down': !$open}"></i>
+                </a>
+            </div>
+            <!--已分配人员-->
+        </div>
+        <div class="pro-add-data02" ng-if="$open">
+            <div class="b2b-com-search search" >
+                <div class="search-result fl"><i class="fa fa-search"></i>  搜索“{{tip}}”,为您找到<em>{{total}}</em>个结果</div>
+                <div class="search-content fr">
+                    <input type="text" placeholder="输入供应商物料关键字查询" ng-model="keyword" autofocus ng-search="onSearch(keyword)"/>
+                    <a class="seek" ng-click="onSearch(keyword)">搜索</a>
+                </div>
+            </div>
+            <table class="b2b-modal-table table" ng-table="tableParams" >
+                <thead>
+                <tr class="header">
+                    <th width="160px">编号</th>
+                    <th width="160px">名称</th>
+                    <th>规格</th>
+                    <th width="80px">单位</th>
+                    <th width="100px">选择</th>
+                </tr>
+                </thead>
+                <tbody ng-if="tableParams.total() == 0">
+                <tr>
+                    <td colspan="5">
+                        <div id="empty">
+                            <div class="left_img">
+                                <a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
+                                <a href="#/index" title="B2B商务首页">B2B 商务</a>
+                            </div>
+                            <div class="right_link">
+                                <p ng-if="tip != null">搜索"{{tip}}"未找到产品信息,请重新输入搜索条件</p>
+                                <p ng-if="tip == null">您的供应商还未添加商品信息,请尽快通知供应商</p>
+                            </div>
+                        </div>
+                    </td>
+                </tr>
+                </tbody>
+                <tbody>
+                <tr ng-repeat="product in $data">
+                    <td class="text-center" ng-bind="::product.code"></td>
+                    <td class="text-center" ng-bind="::product.title"></td>
+                    <td class="text-center f12" ng-bind="::product.spec"></td>
+                    <td class="text-center" ng-bind="::product.unit"></td>
+                    <td class="text-center" ><a title="购买" href="javascript:void(0)" ng-click="PurcByEnAndProd(vendor.enBussinessCode, product.id)" style="text-decoration: none; color: #3f84f6;" id="click" class="add01">购买</a>
+                        <a title="购买" href="javascript:void(0)" ng-click="PurcInquiry(vendor.enBussinessCode, product.id)" style="text-decoration: none; color: #3f84f6;" id="click" class="add01">询价</a>
+                    </td>
+                </tr>
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>

+ 0 - 142
src/main/webapp/resources/view/usercenter/b2b/vendor/vendor.html

@@ -1,142 +0,0 @@
-<style>
-.wrap-content table{
-	background-color: #fff;
-}
-
-.wrap-content table .table-hover {
-	border: 1px red solid;
-}
-#customer-tab .header th,#customer-tab tbody tr.header,#customer-tab tbody tr.header th{
-	height: 38px;
-	text-align: center;
-	padding: 0;
-	line-height: 38px;
-	border-bottom-width: 0;
-	background: #f5f5f5;
-	border: none;
-	font-size: 12px;
-}
-#customer-tab tbody tr.header:hover{
-	border: none;
-}
-.pane-header{
-	/*border-radius: 0px 0 0px 0px;
-	box-shadow: 0 0 3px #ccc;
-	background: linear-gradient(to top, #e7e7e7 0%,#ffffff 100%);*/
-	height: 40px;
-	font-size: 14px;
-	line-height: 40px;}
-#customer-tab .pane-header th{
-	border-bottom: none;
-}
-.table>tbody+tbody{
-	border-top: none;
-}
-#customer-tab tbody td{
-	border: none;
-}
-#customer-tab .pane-body{
-	padding: 0;
-}
-#customer-tab tbody tr{
-	background: none;
-	height: 100px;
-	border-top: #e8e8e8 1px solid;
-	line-height: 100px;
-}
-#customer-tab tbody tr td{
-	text-align: center;
-	line-height: 20px;
-	vertical-align: inherit;
-	font-size: 14px;
-}
-#customer-tab tbody tr:hover{
-	border: #3f84f6 2px solid;
-}
-#customer-tab .com_title{
-	margin-bottom: 10px;
-}
-#customer-tab tbody tr td a{
-	color: #5078cb;
-}
-#customer-tab tbody tr td a:hover{
-	color: #d32526 !important;
-	text-decoration: underline !important;
-}
-#customer-tab table tr td a.color32{
-	color: #323232;
-}
-</style>
-<div class="pub-com_head">
-	<span>供应商资料</span>
-	<div class="p-right">
-	</div>
-</div>
-<div id="public">
-	<div class="condition block" style="padding: 10px 15px;">
-		<div class="search-bg condition block"  style="padding: 10px 15px;">
-			<div class="row">
-				<div id="topSearch" style="float: left">
-					<span class="text-muted f16"><i class="fa fa-search fa-lg"></i> 搜索"{{tip}}",为您找到结果:</span>
-					单据{{total}}条
-				</div>
-				<div class="col-xs-6">
-					<div class="search">
-						<div class="form-group form-group-sm has-feedback" dropdown auto-close="outsideClick" on-toggle="searchAdvance=open">
-							<input type="search" class="form-control input-sm" ng-model="keyword" ng-search="onSearch(keyword)" placeholder="输入企业名称、营业执照号、申请人或审核人"  style="width: 100%"/>
-							<a class="btn input-group-addon" ng-click="onSearch(keyword)">搜索</a>
-						</div>
-					</div>
-				</div>
-			</div>
-		</div>
-	</div>
-</div>
-<div class="wrap-content" id="customer-tab">
-	<div>
-		<!--供应商列表-->
-		<table class="table  table-hover"
-			ng-table="customerParams">
-			<thead>
-				<tr class="pane-header">
-					<th width="80" class="text-center">UU</th>
-					<th width="180" class="text-center">供应商名称</th>
-					<th width="120" class="text-center">简称</th>
-					<th width="200" class="text-center">地址</th>
-					<th width="100" class="text-center">联系人</th>
-					<th width="80" class="text-center">联系电话</th>
-					<th width="170" class="text-center">操作</th>
-				</tr>
-			</thead>
-			<tbody ng-if="$data.length === 0">
-			<tr>
-				<td colspan="7">
-					<div id="empty">
-						<div class="left_img">
-							<a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
-							<a href="#/index" title="B2B商务首页">B2B 商务</a>
-						</div>
-						<div class="right_link">
-							<p>暂无对应的供应商信息</p>
-						</div>
-					</div>
-				</td>
-			</tr>
-			</tbody>
-			<tbody>
-					<tr ng-repeat="vendor in $data">
-						<td ng-bind="::vendor.vendorEnterprise.uu"></td>
-						<td class="text-center"><a href="#/purc/vendor/{{vendor.id}}" ng-bind="::vendor.vendorEnterprise.enName" title="查看供应商资料" class="color32 order-detail"></a></td>
-						<td class="text-center" ng-bind="::vendor.vendorEnterprise.enShortname"></td>
-						<td class="text-center" ng-bind="::vendor.vendorEnterprise.enAddress"></td>
-						<td class="text-center" ng-bind="::vendor.vendorUser.userName"></td>
-						<td class="text-center" ng-bind="::vendor.vendorUser.userTel"></td>
-						<td class="text-center">
-							<a ng-click="purcByEn(vendor.vendorEnterprise.enBussinessCode)">下采购单</a>
-							<a href="#/purc/purcinquiry/{{vendor.vendorEnterprise.enBussinessCode}}">立即询价</a>
-						</td>
-					</tr>
-			</tbody>
-		</table>
-	</div>
-</div>