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

Merge remote-tracking branch 'origin/release-B2bOrSsr-wangcz' into release-B2bOrSsr-wangcz

# Conflicts:
#	src/main/webapp/resources/js/common/services.js
wangcz 7 лет назад
Родитель
Сommit
eee7c25efd
61 измененных файлов с 3104 добавлено и 137 удалено
  1. BIN
      src/main/webapp/resources/img/full_ico.png
  2. 143 2
      src/main/webapp/resources/js/common/b2bServices.js
  3. 2 2
      src/main/webapp/resources/js/common/services/Token.js
  4. 2 0
      src/main/webapp/resources/js/sso/controllers/b2b/addPartnerRequestCtrl.js
  5. 2 0
      src/main/webapp/resources/js/sso/controllers/b2b/customersInfoCtrl.js
  6. 2 0
      src/main/webapp/resources/js/sso/controllers/b2b/newPartnerCtrl.js
  7. 2 0
      src/main/webapp/resources/js/sso/controllers/b2b/servicerInfoCtrl.js
  8. 2 0
      src/main/webapp/resources/js/sso/controllers/b2b/vendorsInfoCtrl.js
  9. 60 26
      src/main/webapp/resources/js/sso/controllers/rolePermissionCtrl.js
  10. 130 6
      src/main/webapp/resources/js/sso/controllers/staffManagementCtrl.js
  11. 1 1
      src/main/webapp/resources/js/usercenter/controllers/b2b/Purc/purchaseInquiryCtrl.js
  12. 1 1
      src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcChangeListCtrl.js
  13. 1 1
      src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcMakeOutOrderCtrl.js
  14. 1 1
      src/main/webapp/resources/js/usercenter/controllers/b2b/order/usercenterOrderCtrl.js
  15. 16 1
      src/main/webapp/resources/js/vendor/app.js
  16. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/apBill.js
  17. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/apCheck.js
  18. 3 3
      src/main/webapp/resources/js/vendor/controllers/b2b/change/sale_inquiry_details.js
  19. 2 2
      src/main/webapp/resources/js/vendor/controllers/b2b/change/sale_inquiry_mould_detail.js
  20. 220 0
      src/main/webapp/resources/js/vendor/controllers/b2b/sale/approval.js
  21. 3 3
      src/main/webapp/resources/js/vendor/controllers/b2b/sale/saleQuotationNewCtrl.js
  22. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_accept.js
  23. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_badIn.js
  24. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_badOut.js
  25. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_make_accept.js
  26. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_make_returns.js
  27. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_returns.js
  28. 368 0
      src/main/webapp/resources/js/vendor/controllers/b2b/sale/sample.js
  29. 109 0
      src/main/webapp/resources/js/vendor/controllers/b2b/sale/sample_detail.js
  30. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/saleChangeCtrl.js
  31. 3 3
      src/main/webapp/resources/js/vendor/controllers/b2b/saleInquiryCtrl.js
  32. 5 1
      src/main/webapp/resources/js/vendor/controllers/b2b/saleInquiryMouldCtrl.js
  33. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/saleMakechangeCtrl.js
  34. 3 3
      src/main/webapp/resources/js/vendor/controllers/b2b/saleMaketodoCtrl.js
  35. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/saleNoticeCtrl.js
  36. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/saleOrderCtrl.js
  37. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/saleQuotationListCtrl.js
  38. 1 1
      src/main/webapp/resources/js/vendor/controllers/b2b/saleSendCtrl.js
  39. 14 4
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js
  40. 26 1
      src/main/webapp/resources/view/sso/b2b/customersInfo.html
  41. 45 0
      src/main/webapp/resources/view/sso/b2b/modal/add_vendor.html
  42. 25 1
      src/main/webapp/resources/view/sso/b2b/myRequest.html
  43. 26 1
      src/main/webapp/resources/view/sso/b2b/newPartner.html
  44. 26 1
      src/main/webapp/resources/view/sso/b2b/servicerInfo.html
  45. 26 2
      src/main/webapp/resources/view/sso/b2b/vendorsInfo.html
  46. 6 1
      src/main/webapp/resources/view/sso/rolePermission.html
  47. 17 6
      src/main/webapp/resources/view/sso/staffManagement.html
  48. 38 37
      src/main/webapp/resources/view/vendor/b2b/change/sale_inquiry_mould_detail.html
  49. 193 0
      src/main/webapp/resources/view/vendor/b2b/modal/sample_send.html
  50. 579 0
      src/main/webapp/resources/view/vendor/b2b/sale/approval.html
  51. 32 7
      src/main/webapp/resources/view/vendor/b2b/sale/sale_badOut.html
  52. 575 0
      src/main/webapp/resources/view/vendor/b2b/sale/sample.html
  53. 366 0
      src/main/webapp/resources/view/vendor/b2b/sale/sample_detail.html
  54. 1 1
      src/main/webapp/resources/view/vendor/b2b/sale_change.html
  55. 1 1
      src/main/webapp/resources/view/vendor/b2b/sale_inquiry.html
  56. 2 2
      src/main/webapp/resources/view/vendor/b2b/sale_inquiryMould.html
  57. 1 0
      src/main/webapp/resources/view/vendor/forstore/vendor_storage.html
  58. 1 0
      src/main/webapp/resources/view/vendor/forstore/vendor_undercarriage.html
  59. 1 0
      src/main/webapp/resources/view/vendor/forstore/vendor_upload.html
  60. 1 1
      src/main/webapp/resources/view/vendor/left_nav.html
  61. 7 1
      src/main/webapp/resources/view/vendor/modal/edit_user_role.html

BIN
src/main/webapp/resources/img/full_ico.png


+ 143 - 2
src/main/webapp/resources/js/common/b2bServices.js

@@ -2782,7 +2782,7 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
         return $resource(b2bUrl + '/sale/inquiry', {}, {
             // 获取最新的已采纳的价信息
             agreed: {
-                url: 'sale/inquiry/recentPrice/:prId',
+                url: b2bUrl + 'sale/inquiry/recentPrice/:prId',
                 method: 'GET'
             }
         });
@@ -2999,5 +2999,146 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
                     method: 'GET'
                 }
             })
-        }]);
+        }])
+        .factory('B2bPurcSample', ['$resource', 'BaseService', function($resource, BaseService) {
+          var b2bUrl = BaseService.getB2bUrl();
+          return $resource(b2bUrl + '/sale/sample/info/search', {}, {
+            getItem: {
+              url: b2bUrl +  '/sale/sample/:id/info',
+              method: 'GET'
+            },
+            printCount: {
+              url: b2bUrl + '/sale/sample/printCount/:id',
+              method: 'POST'
+            },
+            printPermission: {
+              url: b2bUrl + '/sale/sample/printCount/permission',
+              method: 'POST'
+            },
+            getSend: {
+              url: b2bUrl + '/sale/sample/:id/send',
+              method: 'GET',
+              params: {
+                id: 'id'
+              },
+              isArray: true
+            },
+            getTodo: {
+              params: {
+                _state: 'todo'
+              }
+            },
+            getDone: {
+              params: {
+                _state: 'done'
+              }
+            },
+            getInvalid: {
+              params: {
+                _state: 'invalid'
+              }
+            },
+            setRead:{
+              url: b2bUrl + '/sale/sample/setRead',
+              method: 'POST'
+            },
+            getUnreadIds:{
+              url: b2bUrl + '/sale/sample/getUnreadIds',
+              method: 'GET'
+            },
+            getUnreadCount:{
+              url: b2bUrl + '/sale/sample/unread',
+              method: 'GET'
+            },
+            exportXls: {
+              url: b2bUrl + '/sale/sample/xls/permission',
+              method: 'GET'
+            }
+          });
+        }]).factory('B2bPurcSampleInfo', ['$resource', 'BaseService', function($resource, BaseService) {
+          var b2bUrl = BaseService.getB2bUrl();
+          return $resource(b2bUrl + '/sale/sample/info/nosearch', {}, {
+            getTodo: {
+              params: {
+                _state: 'todo'
+              }
+            },
+            getDone: {
+              params: {
+                _state: 'done'
+              }
+            },
+            getInvalid: {
+              params: {
+                _state: 'invalid'
+              }
+            }
+          });
+        }])
+        .factory('B2bPurcApproval', ['$resource',  'BaseService', function($resource, BaseService) {
+          var b2bUrl = BaseService.getB2bUrl();
+          return $resource(b2bUrl + '/sale/sample/approval/info/search', {}, {
+            getItem: {
+              url: b2bUrl + '/sale/sample/approval/:id/info',
+              method: 'GET'
+            },
+            getAgreed: {
+              params: {
+                _state: 'agreed'
+              }
+            },
+            getRefused: {
+              params: {
+                _state: 'refused'
+              }
+            },
+            exportXls: {
+              url: b2bUrl + '/sale/sample/approval/xls/permission',
+              method: 'GET'
+            }
+          });
+        }])
+        .factory('B2bAccountRole', ['$resource', 'BaseService', function($resource, BaseService) {
+        		var b2bUrl = BaseService.getB2bUrl();
+        		return $resource(b2bUrl + '/account/role/:id', {}, {
+        			// 确认修改
+        			save: {
+        				url: b2bUrl + '/account/role',
+        				method: 'POST'
+        			},
+        			// 确认删除
+                    remove: {
+        				url: b2bUrl + '/account/role/:id',
+        				method: 'DELETE'
+        			},
+        			// 恢复默认
+                    recover: {
+                        url: b2bUrl + '/account/role/recover/:roleId',
+                        method: 'POST'
+                    },
+                    // 获取默认权限
+                    getDefaultRole: {
+                        url: b2bUrl + '/account/role/default/:roleId',
+                        method: 'GET'
+                    },
+        			updateDefault: {
+        				url: b2bUrl + '/account/role/updateDefault',
+        				method: 'POST'
+        			}
+        		});
+        	}])
+        .factory('B2bAccountResource', ['$resource', 'BaseService', function($resource, BaseService) {
+            return $resource(BaseService.getB2bUrl() + '/account/resource', {});
+        }]).
+        factory('B2bUser', ['$resource', 'BaseService', function($resource, BaseService) {
+            var b2bUrl = BaseService.getB2bUrl();
+            return $resource(b2bUrl + '/user/findByUserUUList', {}, {
+                getUsersByUU: {
+                    url: b2bUrl + '/user/findByUserUUList',
+                    method: 'GET',
+                    isArray: true
+                }
+            });
+        }])
+
 });

+ 2 - 2
src/main/webapp/resources/js/common/services/Token.js

@@ -1,9 +1,9 @@
 define([ 'ngResource'], function() {
 	angular.module('TokenService', [ 'ngResource']).factory('token', ['$resource', 'BaseService', function($resource, BaseService) {
     var rootPath = BaseService.getB2bUrl();
-		return $resource(rootPath + 'token', {}, {
+		return $resource(rootPath + '/token', {}, {
 			info: {
-				url: rootPath + 'token',
+				url: rootPath + '/token',
 				mehtod: 'GET'
 			}
 		})

+ 2 - 0
src/main/webapp/resources/js/sso/controllers/b2b/addPartnerRequestCtrl.js

@@ -62,6 +62,8 @@ define(['app/app'], function (app) {
                   if (page) {
                       params.total(page.totalElement);
                       $defer.resolve(page.content);
+                    $scope.infoCommon = page
+                    $scope.infoCommon.all = page.content.length
                       $scope.keywordXls = angular.copy(pageParams.keyword);//保存当前取值的关键词
                   }
               }, function (response) {

+ 2 - 0
src/main/webapp/resources/js/sso/controllers/b2b/customersInfoCtrl.js

@@ -28,6 +28,8 @@ define(['app/app'], function (app) {
                   if (page) {
                       params.total(page.totalElement);
                       $scope.total = page.totalElement;
+                    $scope.infoCommon = page
+                    $scope.infoCommon.all = page.content.length
                       $defer.resolve(page.content);
                   }
                   $scope.totalCount = page.totalElement;

+ 2 - 0
src/main/webapp/resources/js/sso/controllers/b2b/newPartnerCtrl.js

@@ -62,6 +62,8 @@ define(['app/app'], function (app) {
                       if (page) {
                           params.total(page.totalElement);
                           $defer.resolve(page.content);
+                        $scope.infoCommon = page
+                        $scope.infoCommon.all = page.content.length
                           $scope.keywordXls = angular.copy(pageParams.keyword);//保存当前取值的关键词
                       }
                   }, function (response) {

+ 2 - 0
src/main/webapp/resources/js/sso/controllers/b2b/servicerInfoCtrl.js

@@ -29,6 +29,8 @@ define(['app/app'], function (app) {
                   if (page) {
                       params.total(page.totalElement);
                       $scope.total = page.totalElement;
+                    $scope.infoCommon = page
+                    $scope.infoCommon.all = page.content.length
                       $defer.resolve(page.content);
                   }
                   $scope.totalCount = page.totalElement;

+ 2 - 0
src/main/webapp/resources/js/sso/controllers/b2b/vendorsInfoCtrl.js

@@ -29,6 +29,8 @@ define(['app/app'], function (app) {
                   if (page) {
                       params.total(page.totalElement);
                       $scope.total = page.totalElement;
+                    $scope.infoCommon = page
+                    $scope.infoCommon.all = page.content.length
                       $defer.resolve(page.content);
                   }
                   $scope.totalCount = page.totalElement;

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

@@ -4,9 +4,10 @@
  */
 define(['app/app'], function (app) {
     "use strict";
-    app.register.controller('rolePermissionCtrl', ['$scope', '$rootScope', 'Enterprise', 'User', 'toaster', '$modal', 'BaseService', 'ngTableParams', '$http', 'AuthenticationService', '$stateParams','AccountResource','AccountRole', 'Authority', function ($scope, $rootScope, Enterprise, User, toaster, $modal, BaseService, ngTableParams, $http, AuthenticationService, $stateParams, AccountResource, AccountRole, Authority) {
+    app.register.controller('rolePermissionCtrl', ['$scope', '$rootScope', 'Enterprise', 'User', 'toaster', '$modal', 'BaseService', 'ngTableParams', '$http', 'AuthenticationService', '$stateParams','AccountResource','AccountRole', 'Authority', 'B2bAccountRole', 'B2bAccountUser', function ($scope, $rootScope, Enterprise, User, toaster, $modal, BaseService, ngTableParams, $http, AuthenticationService, $stateParams, AccountResource, AccountRole, Authority, B2bAccountRole, B2bAccountUser) {
         $rootScope.active = 'sso_permission';
         document.title = '角色权限';
+        $scope.tab = 'b2c';
         $scope.addingUser = false;
         $scope.setAddingUser = function (status) {
             $scope.addingUser = status;
@@ -363,30 +364,50 @@ define(['app/app'], function (app) {
             $scope.resources = data;
         });
         var getData = function () {
-            AccountRole.findAll({}, function (data) {
-                var defaults = [], custom = [];
-                angular.forEach(data, function (d) {
-                    if (d.isdefault == 1)
-                        defaults.push(d);
-                    else
-                        custom.push(d);
+            if ($scope.tab == 'b2c') {
+                AccountRole.findAll({}, function (data) {
+                    var defaults = [], custom = [];
+                    angular.forEach(data, function (d) {
+                        if (d.isdefault == 1)
+                            defaults.push(d);
+                        else
+                            custom.push(d);
+                    });
+                    $scope.roles = {defaults: defaults, custom: custom};
+                },function (error) {
+                    $scope.rolesExcept = error.data;
                 });
-                $scope.roles = {defaults: defaults, custom: custom};
-            },function (error) {
-                $scope.rolesExcept = error.data;
-            });
-            AccountRole.getByExistRoleAndEnuu({}, function (data) {
-                var defaults = [], custom = [];
-                angular.forEach(data, function (d) {
-                    if (d.isdefault == 1)
-                        defaults.push(d);
-                    else
-                        custom.push(d);
+                // 这个请求不知道干嘛的
+                AccountRole.getByExistRoleAndEnuu({}, function (data) {
+                    var defaults = [], custom = [];
+                    angular.forEach(data, function (d) {
+                        if (d.isdefault == 1)
+                            defaults.push(d);
+                        else
+                            custom.push(d);
+                    });
+                    $scope.existRoles = {defaults: defaults, custom: custom};
                 });
-                $scope.existRoles = {defaults: defaults, custom: custom};
-            });
+            } else {
+                B2bAccountRole.query({}, function (data) {
+                    var defaults = [], custom = [];
+                    angular.forEach(data, function (d) {
+                        if (d.isdefault == 1)
+                            defaults.push(d);
+                        else
+                            custom.push(d);
+                    });
+                    $scope.roles = {defaults: defaults, custom: custom};
+                },function (error) {
+                    $scope.rolesExcept = error.data;
+                })
+            }
         };
         getData();
+        $scope.setTab = function (tab) {
+            $scope.tab = tab;
+            getData();
+        }
         $scope.editRole = function (role) {
             var modalInstance = $modal.open({
                 animation: true,
@@ -395,6 +416,9 @@ define(['app/app'], function (app) {
                 resolve: {
                     role: function () {
                         return role;
+                    },
+                    isB2b: function () {
+                        return $scope.tab == 'b2b';
                     }
                 }
             });
@@ -522,8 +546,8 @@ define(['app/app'], function (app) {
           };
         }]);
 
-//角色管理-编辑角色controller
-    app.register.controller('RoleEditCtrl', ['$scope', '$modalInstance', '$timeout', 'AccountResource', 'AccountRole', 'toaster', 'role', 'BaseService', function ($scope, $modalInstance, $timeout, AccountResource, AccountRole, toaster, role, BaseService) {
+    //角色管理-编辑角色controller
+    app.register.controller('RoleEditCtrl', ['$scope', '$modalInstance', '$timeout', 'AccountResource', 'AccountRole', 'toaster', 'role', 'BaseService', 'isB2b', 'B2bAccountResource', 'B2bAccountRole', function ($scope, $modalInstance, $timeout, AccountResource, AccountRole, toaster, role, BaseService, isB2b, B2bAccountResource, B2bAccountRole) {
         BaseService.scrollBackToTop();
         $scope.role = angular.copy(role || {});
         $scope.master = angular.copy($scope.role);
@@ -558,8 +582,18 @@ define(['app/app'], function (app) {
                 });
             }
         }
+        var getB2bResource = function () {
+            return isB2b ? {
+                AccountResource: B2bAccountResource,
+                AccountRole: B2bAccountRole
+            } : {
+                AccountResource: AccountResource,
+                AccountRole: AccountRole
+            }
+        }
+        var queryObj = getB2bResource();
 
-        AccountResource.query({}, function (data) {
+        queryObj.AccountResource.query({}, function (data) {
             if (data && data.length > 0) {
                 var rs = [];// 已分配的资源的id
                 if (role && role.resourceItems) {
@@ -714,7 +748,7 @@ define(['app/app'], function (app) {
             if (!$scope.master.color || $scope.master.color == '') {
                 $scope.master.color = parseInt(Math.random() * 5) + 1 + '';
             }
-            AccountRole.save($scope.master, function () {
+            queryObj.AccountRole.save($scope.master, function () {
                 toaster.pop('success', '提示', '角色:' + $scope.role.desc + ' 资料' + (isNew ? '添加' : '修改') + '成功');
                 $modalInstance.close(true);
             }, function (response) {
@@ -723,7 +757,7 @@ define(['app/app'], function (app) {
         };
         $scope.del = function () {
             if (confirm('确定删除角色(' + $scope.role.desc + ')吗?')) {
-                AccountRole.remove({id: role.id}, function () {
+                queryObj.AccountRole.remove({id: role.id}, function () {
                     toaster.pop('success', '提示', '角色:' + $scope.role.desc + ' 删除成功');
                     $modalInstance.close(true);
                 }, function (response) {

+ 130 - 6
src/main/webapp/resources/js/sso/controllers/staffManagementCtrl.js

@@ -4,7 +4,7 @@
  */
 define(['app/app'], function (app) {
     "use strict";
-    app.register.controller('staffManagementCtrl', ['$scope', '$rootScope', 'Enterprise', 'User', 'toaster', '$modal', 'BaseService', 'ngTableParams', '$http', 'AuthenticationService', '$stateParams','AccountResource','AccountRole', 'Authority', function ($scope, $rootScope, Enterprise, User, toaster, $modal, BaseService, ngTableParams, $http, AuthenticationService, $stateParams, AccountResource, AccountRole, Authority) {
+    app.register.controller('staffManagementCtrl', ['$scope', '$rootScope', 'Enterprise', 'User', 'toaster', '$modal', 'BaseService', 'ngTableParams', '$http', 'AuthenticationService', '$stateParams','AccountResource','AccountRole', 'Authority', 'B2bUser', 'B2bCurrentRole', function ($scope, $rootScope, Enterprise, User, toaster, $modal, BaseService, ngTableParams, $http, AuthenticationService, $stateParams, AccountResource, AccountRole, Authority, B2bUser, B2bCurrentRole) {
         $rootScope.active = 'sso_management';
         document.title = '员工管理-帐户中心';
         $scope.tab = 'auth';
@@ -142,6 +142,18 @@ define(['app/app'], function (app) {
                             $defer.resolve(page.content);
                             $scope.users = page.content;
                             $scope.reloadUserCheck(false);
+                            var arr = [];
+                            angular.forEach($scope.users, function (item) {
+                                arr.push(item.userUU);
+                            })
+                            B2bUser.getUsersByUU({userUUJson: JSON.stringify(arr)}, function (data) {
+                                angular.forEach($scope.users, function (item, index) {
+                                    item.b2bRoles = data[index].roles;
+                                })
+                                console.log($scope.users);
+                            }, function () {
+                                toaster.pop('获取b2b角色信息失败');
+                            })
                         }
                     },function (error) {
                         toaster.pop('error', '获取企业人员信息失败',error.data);
@@ -464,6 +476,41 @@ define(['app/app'], function (app) {
             });
         };
 
+        // b2b客户分配
+        $scope.addVendor = function (user) {
+            B2bCurrentRole.roles({}, function(data) {
+                var roles = data.count || $scope.userInfo.sys;
+                if (!roles) {
+                    toaster.pop('error', '提示', '你不是管理员或销售经理,无权限分配!请立即联系管理员');
+                } else {
+                    for (var i = 0; i < user.b2bRoles.length; i++) {
+                        if (user.b2bRoles[i].issys == 1 || user.b2bRoles[i].name == 'ROLE_SALEMANAGER') {
+                            toaster.pop('error', '提示', '管理员和销售经理无需分配客户');
+                            return;
+                        }
+                    }
+                    var modalInstance = $modal.open({
+                        animation: true,
+                        templateUrl: 'static/view/sso/b2b/modal/add_vendor.html',
+                        controller: 'AddVendorCtrl',
+                        resolve: {
+                            user: function () {
+                                return user;
+                            }
+                        }
+                    });
+                    // modalInstance.result.then(function (changed, checked) {
+                    //     if (changed) {
+                    //         if (checked)
+                    //             $scope.newUser.roles = checked;
+                    //         else
+                    //             loadUsers();
+                    //     }
+                    // });
+                }
+            });
+        };
+
         $scope.inSelect = false;
         $scope.setInSelect = function (status) {
             $scope.inSelect = status;
@@ -568,7 +615,10 @@ define(['app/app'], function (app) {
                 }]);
     }]);
 
-    app.register.controller('UserRoleEditCtrl', ['$scope', '$modalInstance', '$timeout', 'AccountResource', 'toaster', 'user', 'BaseService', 'AccountRole', 'User', function ($scope, $modalInstance, $timeout, AccountResource, toaster, user, BaseService, AccountRole, User) {
+    app.register.controller('UserRoleEditCtrl', ['$scope', '$modalInstance', '$timeout', 'AccountResource', 'toaster', 'user', 'BaseService', 'AccountRole', 'User', 'B2bAccountRole', 'B2bAccountUser', function ($scope, $modalInstance, $timeout, AccountResource, toaster, user, BaseService, AccountRole, User, B2bAccountRole, B2bAccountUser) {
+
+        // 分b2b和b2c
+        $scope.tab = 'b2c';
 
         $scope.pages = [];
 
@@ -585,16 +635,27 @@ define(['app/app'], function (app) {
             $scope.currentRoles = $scope.rolesData.slice(start, end);
         };
 
+        $scope.queryObj = {};
+        var initQueryObj = function () {
+            $scope.queryObj = $scope.tab == 'b2b' ? {
+                AccountRole: B2bAccountRole,
+                User: B2bAccountUser
+            } : {
+                AccountRole: AccountRole,
+                User: User
+            };
+        }
+        initQueryObj();
         var init = function () {
             $scope.user = angular.copy(user);
-            AccountRole.query({}, function (data) {
+            $scope.queryObj.AccountRole.query({}, function (data) {
                 $scope.rolesData = data;
                 loadCurrentRoles();
                 $scope.params.totalPage = Math.ceil($scope.rolesData.length / 6);
                 $scope.acculatePages(1, $scope.params.totalPage);
                 angular.forEach($scope.rolesData, function (item) {
                     item.checked = false;
-                    angular.forEach($scope.user.roles, function (userItem) {
+                    angular.forEach($scope.user[$scope.tab == 'b2b' ? 'b2bRoles' : 'roles'], function (userItem) {
                         if (item.id === userItem.id) {
                             item.checked = true;
                         }
@@ -604,6 +665,12 @@ define(['app/app'], function (app) {
         }
         init();
 
+        $scope.switchTab = function (tab) {
+            $scope.tab = tab;
+            initQueryObj();
+            init();
+        }
+
         $scope.checked = [];
         //勾选角色
         $scope.checkRole = function (role) {
@@ -623,9 +690,9 @@ define(['app/app'], function (app) {
                         }
                     });
                     $scope.user.roles = $scope.checked;
-                    User.update({}, $scope.user, function () {
+                    $scope.queryObj.User[$scope.tab == 'b2b' ? 'updateRole' : 'update']({}, $scope.user, function () {
                         toaster.pop('success', '提示', '保存成功');
-                        user.roles = $scope.checked
+                        user[$scope.tab == 'b2b' ? 'b2bRoles' : 'roles'] = $scope.checked;
                         $modalInstance.close(true);
                     }, function (response) {
                         toaster.pop('error', '保存失败', response.data);
@@ -824,4 +891,61 @@ define(['app/app'], function (app) {
             $scope.acculatePages($scope.params.page, $scope.params.totalPage);
         };
     }]);
+
+    app.register.controller('AddVendorCtrl', ['$scope', '$modalInstance', 'user', 'B2bAccountUser', 'toaster', function ($scope, $modalInstance, user, AccountUser, toaster) {
+        $scope.checkboxes = {
+            checked: false
+        };
+        $scope.loading = true;
+        AccountUser.findVendor({uu: user.userUU}, function (data) {
+            $scope.enters = data;
+            $scope.loading = false;
+        })
+        // 点击勾选全部的复选框
+        $scope.checkAll = function () {
+            angular.forEach($scope.enters, function (item) {
+                item.distribute = $scope.checkboxes.checked;
+            });
+        };
+        // 点击其中一个明细的复选框
+        $scope.checkOne = function (vendor) {
+            var result = true;
+            angular.forEach($scope.enters, function (item) {
+                if (item.distribute != true) {
+                    result = false;
+                    return;
+                }
+            });
+            $scope.checkboxes.checked = result;
+        };
+        $scope.close = function (save) {
+            var chooseResult = [];
+            if (save) {
+                if (user.userUU) {
+                    angular.forEach($scope.enters, function (item, i) {
+                        chooseResult.push(item);
+                    });
+                    if (chooseResult.length > 0) {
+                        $scope.loading = true;
+                        AccountUser.addVendor({uu: user.userUU}, chooseResult, function (data) {
+                            $scope.loading = false;
+                            toaster.pop('success', '提示', '保存成功');
+                            $modalInstance.close(false);
+                        }, function (response) {
+                            $scope.loading = false;
+                            toaster.pop('error', '保存失败', response.data);
+                            $modalInstance.close(false);
+                        })
+                    } else {
+                        toaster.pop('error', '保存失败', "您未勾选任何记录");
+                    }
+                } else {
+                    $modalInstance.close(true, $scope.checkboxes.checked);
+                }
+            } else {
+                $modalInstance.close(false);
+            }
+        };
+    }]);
+
 });

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/b2b/Purc/purchaseInquiryCtrl.js

@@ -189,7 +189,7 @@ define(['app/app'], function(app) {
     $scope.exportXls = function () {
       PurchaseInquiry.exportXls({}, {}, function (data) {
         if (data.success){
-          window.location.href = 'purc/inquiry/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+          window.location.href = BaseService.getB2bUrl() + '/purc/inquiry/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
         }
       }, function (response) {
         toaster.pop('error', '数据加载失败', response.data);

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcChangeListCtrl.js

@@ -200,7 +200,7 @@ define(['app/app'], function(app) {
         $scope.exportXls = function () {
             change.exportXls({}, {}, function (data) {
                 if (data.success){
-                    window.location.href = 'purc/change/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+                    window.location.href = BaseService.getB2bUrl() + '/purc/change/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
                 }
             }, function (response) {
                 toaster.pop('error', '数据加载失败', response.data);

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcMakeOutOrderCtrl.js

@@ -232,7 +232,7 @@ define(['app/app'], function(app) {
         $scope.exportXls = function () {
             MakeOutOrder.exportXls({}, {}, function (data) {
                 if (data.success){
-                    window.location.href = 'make/outorders/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+                    window.location.href = BaseService.getB2bUrl() + '/make/outorders/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
                 }
             }, function (response) {
                 toaster.pop('error', '数据加载失败', response.data);

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/b2b/order/usercenterOrderCtrl.js

@@ -354,7 +354,7 @@ define(['app/app'], function(app) {
             $scope.exportXls = function () {
                 PurcOrders.exportXls({}, {}, function (data) {
                     if (data.success){
-                        window.location.href = 'sale/orders/purc/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+                        window.location.href = BaseService.getB2bUrl() + '/sale/orders/purc/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
                     }
                 }, function (response) {
                     toaster.pop('error', '数据加载失败', response.data);

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

@@ -868,7 +868,22 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			templateUrl: "static/view/vendor/b2b/sale/vendorPerformanceAssess_detail.html",
 			controller: 'VendorPerformanceAssessDetailCtrl',
 			controllerUrl: 'app/controllers/b2b/sale/VendorPerformanceAssessDetailCtrl'
-		}));
+		})).state('sale_sample', angularAMD.route({
+      url: "/sample",
+      templateUrl: "static/view/vendor/b2b/sale/sample.html",
+      controller: 'SaleSampleCtrl',
+      controllerUrl: 'app/controllers/b2b/sale/sample'
+    })).state('sale_sample_detail', angularAMD.route({
+      url: "/sample/:id",
+      templateUrl: "static/view/vendor/b2b/sale/sample_detail.html",
+      controller: 'SaleSampleDetailCtrl',
+      controllerUrl: 'app/controllers/b2b/sale/sample_detail'
+    })).state('sale_approval', angularAMD.route({
+      url: "/approval",
+      templateUrl: "static/view/vendor/b2b/sale/approval.html",
+      controller: 'SaleApprovalCtrl',
+      controllerUrl: 'app/controllers/b2b/sale/approval'
+    }));
 	}]);
 
 	// 状态码  -> 描述

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/apBill.js

@@ -124,7 +124,7 @@ define(['app/app'], function (app) {
           $scope.exportXls = function () {
             FaApBill.exportXls({}, {}, function (data) {
               if (data.success) {
-                window.location.href = 'sale/apBill/xls?_state=' + $scope.active
+                window.location.href = BaseService.getB2bUrl() + '/sale/apBill/xls?_state=' + $scope.active
                     + '&keyword=' + ($scope.keywordXls || "") + '&fromDate='
                     + $scope.fromDateXls + '&endDate=' + $scope.endDateXls;
               }

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/apCheck.js

@@ -166,7 +166,7 @@ define(['app/app'], function (app) {
     $scope.exportXls = function () {
       FaApCheck.exportXls({}, {}, function (data) {
         if (data.success){
-          window.location.href = 'sale/apCheck/xls/list?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+          window.location.href = BaseService.getB2bUrl() + '/sale/apCheck/xls/list?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
         }
       }, function (response) {
         toaster.pop('error', '数据加载失败', response.data);

+ 3 - 3
src/main/webapp/resources/js/vendor/controllers/b2b/change/sale_inquiry_details.js

@@ -1,6 +1,6 @@
 // 询价单明细
 define(['app/app'], function (app) {
-  app.register.controller('saleInquiryDetailCtrl', ['$rootScope', '$scope', '$stateParams', 'B2bPurcInquiry', '$filter', 'toaster', '$upload', 'token', 'B2bCurrentRole', function ($rootScope, $scope, $stateParams, PurcInquiry, $filter, toaster, $upload, token, CurrentRole) {
+  app.register.controller('saleInquiryDetailCtrl', ['BaseService', '$rootScope', '$scope', '$stateParams', 'B2bPurcInquiry', '$filter', 'toaster', '$upload', 'token', 'B2bCurrentRole', function (BaseService, $rootScope, $scope, $stateParams, PurcInquiry, $filter, toaster, $upload, token, CurrentRole) {
       $rootScope.active = 'vendor_seek_purchase';
       // 获取当前用户是否为普通用户
       CurrentRole.isUser({}, {}, function (data) {
@@ -147,7 +147,7 @@ define(['app/app'], function (app) {
               if (withSteps) {
                   if(null != file) {
                       $upload.upload({
-                          url: 'sale/inquiry/addAttach',
+                          url: BaseService.getB2bUrl() + '/sale/inquiry/addAttach',
                           file: file,
                           method: 'POST',
                           data: {
@@ -174,7 +174,7 @@ define(['app/app'], function (app) {
               } else {
                   if(null != file) {
                       $upload.upload({
-                          url: 'sale/inquiry/addAttach',
+                          url:BaseService.getB2bUrl() + '/sale/inquiry/addAttach',
                           file: file,
                           method: 'POST',
                           data: {

+ 2 - 2
src/main/webapp/resources/js/vendor/controllers/b2b/change/sale_inquiry_mould_detail.js

@@ -1,6 +1,6 @@
 // 客户模具询价单
 define(['app/app'], function (app) {
-  app.register.controller('saleInquiryMouldDetailCtrl', ['$scope', '$stateParams', 'B2bPurcInquiryMould', '$filter', 'toaster', '$upload', 'B2bCurrentRole', function ($scope, $stateParams, PurcInquiryMould, $filter, toaster, $upload, CurrentRole) {
+  app.register.controller('saleInquiryMouldDetailCtrl', ['BaseService', '$scope', '$stateParams', 'B2bPurcInquiryMould', '$filter', 'toaster', '$upload', 'B2bCurrentRole', function (BaseService, $scope, $stateParams, PurcInquiryMould, $filter, toaster, $upload, CurrentRole) {
       // 获取当前用户是否为普通用户
       CurrentRole.isUser({}, {}, function (data) {
           $scope.isUser = data.isUser;
@@ -107,7 +107,7 @@ define(['app/app'], function (app) {
 //			var file = mould.attachFile.$viewValue, file = file && file.length > 0 ? file[0] : null;
           $scope.mould  = $scope.inquiryMould;
           $upload.upload({
-              url: 'sale/mould/' + $scope.mould.id + '/send',
+              url: BaseService.getB2bUrl() +'sale/mould/' + $scope.mould.id + '/send',
               method: 'POST',
               file: file,
               data: {

+ 220 - 0
src/main/webapp/resources/js/vendor/controllers/b2b/sale/approval.js

@@ -0,0 +1,220 @@
+define(['app/app'], function (app) {
+  /**
+   * 客户认定单
+   */
+  app.register.controller('SaleApprovalCtrl', ['$rootScope', '$scope', '$filter', 'B2bPurcApproval', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function ($rootScope, $scope, $filter, PurcApproval, ngTableParams, toaster, BaseService, Symbol) {
+    BaseService.scrollBackToTop();
+    $rootScope.active = 'vendor_sample'
+    $scope.storeType = 'approval'
+    $scope.active = 'all';
+    $scope.agreedText = '全部';
+    $scope.dateZoneText = '一个月内';
+    $scope.condition = {dateZone: 1};
+
+    /* 时间筛选初始化*/
+    var fromDate = new Date();
+    var toDate = new Date();
+    fromDate.setMonth(fromDate.getMonth() - 1);
+    fromDate.setHours(0, 0, 0, 0);
+    toDate.setHours(23, 59, 59, 999);
+    $scope.condition.dateFrom = fromDate;
+    $scope.condition.dateTo = toDate;
+
+    $scope.currency = Symbol.currency;//将币别转化为对应的符号
+    $scope.changeDateZone = function (zone) {
+      $scope.condition.dateZone = zone;
+      $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
+      $scope.condition.$dateZoneOpen = false;
+      getDateCondition(zone, $scope.condition);
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+    $scope.setActive = function (state) {
+      if ($scope.active != state) {
+        $scope.active = state;
+        if ($scope.tableParams.page() == 1)
+          $scope.tableParams.reload();
+        else
+          $scope.tableParams.page(1);
+      }
+    };
+    var getService = function () {
+      return PurcApproval;
+    };
+
+    $scope.tableParams = new ngTableParams({
+      page: 1,
+      count: 20,
+      sorting: {
+        inDate: 'desc'
+      }
+    }, {
+      total: 0,
+      counts: [5, 10, 25, 50],
+      getData: function ($defer, params) {
+        $scope.loading = true;
+        var pageParams = params.url();
+        pageParams.keyword = $scope.keyword;
+        pageParams.fromDate = $scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null;
+        pageParams.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
+        getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
+          $scope.loading = false;
+          if (page) {
+            params.total(page.totalElement);
+            $defer.resolve(page.content);
+            $scope.infoCommon = page
+            $scope.infoCommon.all = page.content.length
+            $scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
+            $scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
+            $scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
+          }
+        }, function (response) {
+          $scope.loading = false;
+          toaster.pop('error', '数据加载失败', response.data);
+        });
+      }
+    });
+
+    $scope.openDatePicker = function ($event, item, openParam) {
+      $event.preventDefault();
+      $event.stopPropagation();
+      item[openParam] = !item[openParam];
+    };
+
+    $scope.openFilterDatePicker = function ($event, item, openParam) {
+      $event.preventDefault();
+      $event.stopPropagation();
+      item[openParam] = !item[openParam];
+      if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
+        $scope.tableParams.reload();
+      }
+    };
+
+    $scope.parseDate = function (dateStr) {
+      if (dateStr)
+        return Date.parse(dateStr, 'yyyy-MM-dd');
+      return new Date();
+    };
+
+    // 搜索框回车
+    $scope.onSearch = function () {
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+
+    // 选择查找日期
+    $scope.onDateCondition = function () {
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+
+    // 导出
+    $scope.exportXls = function () {
+      PurcApproval.exportXls({}, {}, function (data) {
+        if (data.success){
+          window.location.href = BaseService.getB2bUrl() + '/sale/sample/approval/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+        }
+      }, function (response) {
+        toaster.pop('error', '数据加载失败', response.data);
+      });
+    }
+
+    /**
+     * 将日期转化为整数日期
+     */
+    var getDateTime = function (date) {
+      if (angular.isDate(date)) {
+        return date.getTime();
+      } else {
+        return null;
+      }
+    }
+
+    /**
+     * 页面状态按钮过滤
+     */
+    var getState = function (active) {
+      var fn = 'get';
+      switch (active) {
+        case 'done':
+          fn = 'getDone';
+          break;
+        case 'todo':
+          fn = 'getTodo';
+          break;
+        case 'end':
+          fn = 'getEnd';
+          break;
+        case 'waiting':
+          fn = 'getWaiting';
+          break;
+        case 'received':
+          fn = 'getReceived';
+          break;
+        case 'invalid':
+          fn = 'getInvalid';
+          break;
+          // 已采纳
+        case 'agreed':
+          fn = 'getAgreed';
+          break;
+          // 未采纳
+        case 'refused':
+          fn = 'getRefused';
+          break;
+          // 个人
+        case 'personal':
+          fn = 'getPersonal';
+          break;
+          // 集体
+        case 'teams':
+          fn = 'getTeams';
+          break;
+          // 非标准
+        case 'nonstandard':
+          fn = 'getNonstandard';
+          break;
+          // 标准
+        case 'standard':
+          fn = 'getStandard';
+          break;
+          // 变更单无需确认
+        case 'unread':
+          fn = 'getUnread';
+          break;
+      }
+      return fn;
+    };
+
+    /**
+     * 改变单据日期范围
+     */
+    var getDateCondition = function (zone, condition) {
+      var fromDate = new Date();
+      var toDate = new Date();
+      //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
+      fromDate.setHours(0, 0, 0, 0);
+      toDate.setHours(23, 59, 59, 999);
+      if (zone == -1) { // 自定义时间,什么都不做
+
+      } else if (zone == 1) {
+        fromDate.setMonth(fromDate.getMonth() - 1);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 3) {
+        fromDate.setMonth(fromDate.getMonth() - 3);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 6) {
+        fromDate.setMonth(fromDate.getMonth() - 6);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else {
+        condition.dateFrom = null;
+        condition.dateTo = null;
+      }
+    };
+
+  }]);
+
+})

+ 3 - 3
src/main/webapp/resources/js/vendor/controllers/b2b/sale/saleQuotationNewCtrl.js

@@ -184,7 +184,7 @@ define(['app/app'], function (app) {
                     if ($stateParams.id)
                         window.location.reload();
                     else
-                        window.location.hash = '#/sale/quotation/list';
+                        window.location.hash = '#/sale/quotationList';
                 }, function (response) {
                     $scope.loading = false;
                     toaster.pop('error', '保存失败', response.data);
@@ -233,7 +233,7 @@ define(['app/app'], function (app) {
                     $scope.item = data;
                     toaster.pop('success', '成功', '提交成功');
                     // window.location.hash = '#/sale/quotation/' + data.id;
-                    window.location.hash = '#/sale/quotation/list';
+                    window.location.hash = '#/sale/quotationList';
                 }, function (response) {
                     $scope.loading = false;
                     toaster.pop('error', '保存失败', response.data);
@@ -243,7 +243,7 @@ define(['app/app'], function (app) {
 
         $scope.deleteById = function (id) {
             Quotation.deleteById({id: id}, {}, function (data) {
-                window.location.href = "#/sale/quotation/list";
+                window.location.href = "#/sale/quotationList";
             }, function (response) {
                 toaster.pop('error', '提示', response.data);
             })

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_accept.js

@@ -124,7 +124,7 @@ define(['app/app'], function (app) {
     $scope.exportXls = function () {
       PurcAccept.exportXls({}, {}, function (data) {
         if (data.success){
-          window.location.href = 'sale/accept/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+          window.location.href = BaseService.getB2bUrl() + '/sale/accept/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
         }
       }, function (response) {
         toaster.pop('error', '数据加载失败', response.data);

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_badIn.js

@@ -110,7 +110,7 @@ define(['app/app'], function (app) {
     $scope.exportXls = function () {
       PurcBadIn.exportXls({}, {}, function (data) {
         if (data.success){
-          window.location.href = 'sale/badIn/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+          window.location.href = BaseService.getB2bUrl() + '/sale/badIn/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
         }
       }, function (response) {
         toaster.pop('error', '数据加载失败', response.data);

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_badOut.js

@@ -118,7 +118,7 @@ define(['app/app'], function (app) {
           $scope.exportXls = function () {
             PurcBadOut.exportXls({}, {}, function (data) {
               if (data.success) {
-                window.location.href = 'sale/badOut/xls?_state=' + $scope.active
+                window.location.href = BaseService.getB2bUrl() + '/sale/badOut/xls?_state=' + $scope.active
                     + '&searchFilter=' + encodeURIComponent(
                         angular.toJson($scope.searchFilterXls));
               }

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_make_accept.js

@@ -120,7 +120,7 @@ define(['app/app'], function (app) {
     $scope.exportXls = function () {
       MakeAccept.exportXls({}, {}, function (data) {
         if (data.success){
-          window.location.href = 'make/accept/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+          window.location.href = BaseService.getB2bUrl() + '/make/accept/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
         }
       }, function (response) {
         toaster.pop('error', '数据加载失败', response.data);

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_make_returns.js

@@ -117,7 +117,7 @@ define(['app/app'], function (app) {
     $scope.exportXls = function () {
       MakeReturn.exportXls({}, {}, function (data) {
         if (data.success){
-          window.location.href = 'make/return/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+          window.location.href = BaseService.getB2bUrl() + '/make/return/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
         }
       }, function (response) {
         toaster.pop('error', '数据加载失败', response.data);

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_returns.js

@@ -117,7 +117,7 @@ define(['app/app'], function (app) {
     $scope.exportXls = function () {
       PurcReturn.exportXls({}, {}, function (data) {
         if (data.success){
-          window.location.href = 'sale/return/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+          window.location.href = BaseService.getB2bUrl() + '/sale/return/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
         }
       }, function (response) {
         toaster.pop('error', '数据加载失败', response.data);

+ 368 - 0
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sample.js

@@ -0,0 +1,368 @@
+define(['app/app'], function (app) {
+  /**
+   * 客户打样申请
+   */
+  app.register.controller('SaleSampleCtrl', ['$scope', '$filter', 'B2bPurcSample', 'ngTableParams', 'toaster', '$modal', 'BaseService', 'B2bReportService', 'Symbol', '$rootScope', 'B2bPurcSampleInfo', 'B2bCurrentRole', function ($scope, $filter, PurcSample, ngTableParams, toaster, $modal, BaseService, ReportService, Symbol, $rootScope, PurcSampleInfo, CurrentRole) {
+    BaseService.scrollBackToTop();
+    // 获取当前用户是否为普通用户
+    CurrentRole.isUser({}, {}, function (data) {
+      $scope.isUser = data.isUser;
+    });
+    $rootScope.active = 'vendor_sample'
+    $scope.storeType = 'sample'
+    // if ($rootScope.active) {
+    //   $scope.active = $rootScope.active;
+    //   $rootScope.active = null;
+    // } else {
+      $scope.active = 'todo';
+    // }
+    $scope.agreedText = '全部';
+    $scope.dateZoneText = '一个月内';
+    $scope.condition = {dateZone: 1};
+
+    /*初始化筛选时间*/
+    var fromDate = new Date();
+    var toDate = new Date();
+    fromDate.setMonth(fromDate.getMonth() - 1);
+    fromDate.setHours(0, 0, 0, 0);
+    toDate.setHours(23, 59, 59, 999);
+    $scope.condition.dateFrom = fromDate;
+    $scope.condition.dateTo = toDate;
+
+    $scope.currency = Symbol.currency;//将币别转化为对应的符号
+    $scope.changeAgreed = function (agreed) {
+      $scope.condition.agreed = agreed;
+      $scope.agreedText = typeof agreed == 'undefined' ? '全部' : (agreed == 1 ? '已同意' : '不同意');
+      $scope.condition.$agreedOpen = false;
+    };
+    $scope.changeDateZone = function (zone) {
+      $scope.condition.dateZone = zone;
+      $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
+      $scope.condition.$dateZoneOpen = false;
+      getDateCondition(zone, $scope.condition);
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+    $scope.setActive = function (state) {
+      if ($scope.active != state) {
+        $scope.active = state;
+        if ($scope.tableParams.page() == 1)
+          $scope.tableParams.reload();
+        else
+          $scope.tableParams.page(1);
+      }
+    };
+
+    $scope.searchMethod = false;
+    var getService = function () {
+      return $scope.searchMethod ? PurcSample : PurcSampleInfo;
+    };
+
+    $scope.tableParams = new ngTableParams({
+      page: 1,
+      count: 20,
+      sorting: {
+        proofingDate: 'desc'
+      }
+    }, {
+      total: 0,
+      counts: [5, 10, 25, 50],
+      getData: function ($defer, params) {
+        $scope.loading = true;
+        var pageParams = params.url();
+        pageParams.searchFilter = {
+          keyword: $scope.keyword,
+          fromDate: getDateTime($scope.condition.dateFrom),
+          endDate: getDateTime($scope.condition.dateTo)
+        };
+        getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
+          $scope.loading = false;
+          if (page) {
+            params.total(page.totalElement);
+            $defer.resolve(page.content);
+            $scope.infoCommon = page
+            $scope.infoCommon.all = page.content.length
+            $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
+          }
+          getUnreadCount();
+        }, function (response) {
+          $scope.loading = false;
+          toaster.pop('error', '数据加载失败', response.data);
+        });
+      }
+    });
+
+    //获得各分类未阅读数量
+    var getUnreadCount = function () {
+      PurcSample.getUnreadCount(null, function(data){
+        $scope.unread = data;
+      });
+    };
+    getUnreadCount();
+
+    //设置单个单据已读
+    $scope.setOrdersRead = function (id) {
+      if (!$scope.isUnread(id)) {
+        return;
+      }
+      var sourceId = [];
+      sourceId.push(id);
+      PurcSample.setRead({}, sourceId, function (message) {
+        getUnreadIds();
+        getUnreadCount();
+      });
+    };
+
+    //获取未读单据id
+    var getUnreadIds = function (){
+      PurcSample.getUnreadIds({}, "", function (message) {
+        $scope.unreadCode = message.content;
+      });
+    };
+    getUnreadIds();
+    //判断单据是否未读
+    $scope.isUnread = function (id){
+      for (var i in $scope.unreadCode) {
+        if (id == $scope.unreadCode[i]) {
+          return true;
+        }
+      }
+    };
+
+    $scope.openDatePicker = function ($event, item, openParam) {
+      $event.preventDefault();
+      $event.stopPropagation();
+      item[openParam] = !item[openParam];
+    };
+
+    $scope.openFilterDatePicker = function ($event, item, openParam) {
+      $event.preventDefault();
+      $event.stopPropagation();
+      item[openParam] = !item[openParam];
+      if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
+        $scope.tableParams.reload();
+      }
+    };
+
+    $scope.openSend = function (index, sample) {
+      var modalInstance = $modal.open({
+        animation: true,
+        templateUrl: 'static/view/vendor/b2b/modal/sample_send.html',
+        controller: 'SampleSendCtrl',
+        resolve: {
+          sampleItem: function () {
+            return sample;
+          }
+        }
+      });
+
+      modalInstance.result.then(function () {
+        toaster.pop('info', '提示', '送样成功');
+        $scope.tableParams.reload();
+      }, function () {
+
+      });
+    };
+    //打印  样品采购单
+    $scope.print = function (sample) {
+      var newPage = window.open("about:blank");
+      PurcSample.printPermission({}, function () {
+        PurcSample.printCount({id: sample.id}, {});//增加打印此次
+        ReportService.print(sample.proofing.enUU, 'PURCPROOFING', "where purc$proofingitems.ppi_id =" + sample.id, newPage);
+      }, function (response) {
+        newPage.close();
+        toaster.pop('error', '打印失败', response.data);
+      });
+    };
+
+    $scope.getSend = function (proofing) {
+      if (!proofing.sends) {
+        proofing.getSendInfo = '加载中...';
+        PurcSample.getSend({id: proofing.id}, function (data) {
+          if (data) {
+            proofing.getSendInfo = null;
+            proofing.sends = data;
+          } else {
+            proofing.getSendInfo = '无送样信息';
+            proofing.sends = '无送样信息';
+          }
+        }, function (response) {
+          proofing.getSendInfo = '加载失败!';
+        });
+      }
+    };
+
+    // 搜索框回车
+    $scope.onSearch = function (keyword) {
+      // 每次搜索重置获取数据方法
+      $scope.searchMethod = false;
+      if(keyword != null && keyword != '') {
+        $scope.searchMethod = true;
+      }
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+
+    // 导出
+    $scope.exportXls = function () {
+      PurcSample.exportXls({}, {}, function (data) {
+        if (data.success){
+          window.location.href = BaseService.getB2bUrl() + '/sale/sample/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+        }
+      }, function (response) {
+        toaster.pop('error', '数据加载失败', response.data);
+      });
+    }
+
+    /**
+     * 将日期转化为整数日期
+     */
+    var getDateTime = function (date) {
+      if (angular.isDate(date)) {
+        return date.getTime();
+      } else {
+        return null;
+      }
+    }
+
+    /**
+     * 页面状态按钮过滤
+     */
+    var getState = function (active) {
+      var fn = 'get';
+      switch (active) {
+        case 'done':
+          fn = 'getDone';
+          break;
+        case 'todo':
+          fn = 'getTodo';
+          break;
+        case 'end':
+          fn = 'getEnd';
+          break;
+        case 'waiting':
+          fn = 'getWaiting';
+          break;
+        case 'received':
+          fn = 'getReceived';
+          break;
+        case 'invalid':
+          fn = 'getInvalid';
+          break;
+          // 已采纳
+        case 'agreed':
+          fn = 'getAgreed';
+          break;
+          // 未采纳
+        case 'refused':
+          fn = 'getRefused';
+          break;
+          // 个人
+        case 'personal':
+          fn = 'getPersonal';
+          break;
+          // 集体
+        case 'teams':
+          fn = 'getTeams';
+          break;
+          // 非标准
+        case 'nonstandard':
+          fn = 'getNonstandard';
+          break;
+          // 标准
+        case 'standard':
+          fn = 'getStandard';
+          break;
+          // 变更单无需确认
+        case 'unread':
+          fn = 'getUnread';
+          break;
+      }
+      return fn;
+    };
+
+    /**
+     * 改变单据日期范围
+     */
+    var getDateCondition = function (zone, condition) {
+      var fromDate = new Date();
+      var toDate = new Date();
+      //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
+      fromDate.setHours(0, 0, 0, 0);
+      toDate.setHours(23, 59, 59, 999);
+      if (zone == -1) { // 自定义时间,什么都不做
+
+      } else if (zone == 1) {
+        fromDate.setMonth(fromDate.getMonth() - 1);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 3) {
+        fromDate.setMonth(fromDate.getMonth() - 3);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 6) {
+        fromDate.setMonth(fromDate.getMonth() - 6);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else {
+        condition.dateFrom = null;
+        condition.dateTo = null;
+      }
+    };
+
+  }]);
+
+  app.register.controller('SampleSendCtrl', ['$scope', '$modalInstance', 'sampleItem', 'B2bPurcSample', '$upload', 'toaster',  'BaseService', function ($scope, $modalInstance, sampleItem, PurcSample, $upload, toaster, BaseService) {
+    var b2bUrl = BaseService.getB2bUrl();
+    if (!sampleItem.sends) {
+      PurcSample.getSend({id: sampleItem.id}, function (data) {
+        if (data) {
+          sampleItem.sends = data; // 获取送样信息
+          angular.forEach(data, function (send) {
+            sampleItem.sendQty = send.sendQty + (sampleItem.sendQty || 0);
+          });
+        }
+      }, function (response) {
+      });
+    }
+    $scope.sampleItem = sampleItem;
+    $scope.sampleItem.sampleSend = $scope.sampleItem.sampleSend || {};
+
+    //确认送样
+    $scope.ok = function (form) {
+      $scope.loading = true;
+      // 多次送样时,由于ng-model是sendQty,所以需要加上送样历史中的数量
+      $scope.sampleItem.sampleSend.sendQty = $scope.sampleItem.sampleSend.sendQty + ($scope.sampleItem.sendQty || 0);
+      $scope.sampleItem.sendQty = $scope.sampleItem.sampleSend.sendQty; // 判断是否需要多次送样
+      var files = form.attachFile.$viewValue, file = files && files.length > 0 ? files[0] : null;
+      $upload.upload({
+        url: b2bUrl + 'sale/sample/' + $scope.sampleItem.id + '/send',
+        method: 'POST',
+        file: file,
+        data: {
+          json: $scope.sampleItem.sampleSend
+        }
+      }).success(function (data) {
+        $scope.loading = false;
+        $modalInstance.close('success');
+      }).error(function (data) {
+        $scope.loading = false;
+        toaster.pop('error', '错误', data);
+      });
+    };
+
+    $scope.cancel = function () {
+      $modalInstance.dismiss(sampleItem);
+    };
+
+    //设置单个单据已读
+    $scope.setOrdersRead = function (id) {
+      var sourceId = [];
+      sourceId.push(id);
+      PurcSample.setRead({}, sourceId, function (message) {
+        // $scope.getUnreadIds();
+      });
+    };
+  }]);
+
+})

+ 109 - 0
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sample_detail.js

@@ -0,0 +1,109 @@
+define(['app/app'], function (app) {
+  app.register.controller('SaleSampleDetailCtrl', ['$rootScope', '$scope', '$stateParams', 'B2bPurcSample', 'toaster', '$modal', 'BaseService', 'B2bCurrentRole', function ($rootScope, $scope, $stateParams, PurcSample, toaster, $modal, BaseService, CurrentRole) {
+    $rootScope.active = 'vendor_sample'
+    BaseService.scrollBackToTop();
+    // 获取当前用户是否为普通用户
+    CurrentRole.isUser({}, {}, function (data) {
+      $scope.isUser = data.isUser;
+    });
+    var loading = true;
+    var loadData = function () {
+      PurcSample.getItem({id: $stateParams.id}, function (data) {
+        $scope.sample = data;
+        if (!$scope.sample.sends) {
+          $scope.sample.getSendInfo = '加载中...';
+          PurcSample.getSend({id: $stateParams.id}, function (sendData) {
+            if (sendData) {
+              $scope.sample.getSendInfo = null;
+              $scope.sample.sends = sendData;
+            } else {
+              $scope.sample.getSendInfo = '无送样信息';
+              $scope.sample.sends = '无送样信息';
+            }
+          }, function (response) {
+            $scope.sample.getSendInfo = '加载失败!';
+            toaster.pop('error', '', response.data);
+          });
+        }
+        $scope.loading = false;
+      }, function (response) {
+        loading = false;
+        toaster.pop('error', '获取数据失败', response.data);
+      });
+    };
+    loadData();
+
+    $scope.openSend = function (index, sample) {
+      var modalInstance = $modal.open({
+        animation: true,
+        templateUrl: 'static/view/vendor/b2b/modal/sample_send.html',
+        controller: 'SampleSendCtrl',
+        resolve: {
+          sampleItem: function () {
+            return sample;
+          }
+        }
+      });
+
+      modalInstance.result.then(function () {
+        toaster.pop('info', '提示', '送样成功');
+        $scope.tableParams.reload();
+      }, function () {
+
+      });
+    };
+  }]);
+  app.register.controller('SampleSendCtrl', ['$scope', '$modalInstance', 'sampleItem', 'B2bPurcSample', '$upload', 'toaster',  'BaseService', function ($scope, $modalInstance, sampleItem, PurcSample, $upload, toaster, BaseService) {
+    var b2bUrl = BaseService.getB2bUrl();
+    if (!sampleItem.sends) {
+      PurcSample.getSend({id: sampleItem.id}, function (data) {
+        if (data) {
+          sampleItem.sends = data; // 获取送样信息
+          angular.forEach(data, function (send) {
+            sampleItem.sendQty = send.sendQty + (sampleItem.sendQty || 0);
+          });
+        }
+      }, function (response) {
+      });
+    }
+    $scope.sampleItem = sampleItem;
+    $scope.sampleItem.sampleSend = $scope.sampleItem.sampleSend || {};
+
+    //确认送样
+    $scope.ok = function (form) {
+      $scope.loading = true;
+      // 多次送样时,由于ng-model是sendQty,所以需要加上送样历史中的数量
+      $scope.sampleItem.sampleSend.sendQty = $scope.sampleItem.sampleSend.sendQty + ($scope.sampleItem.sendQty || 0);
+      $scope.sampleItem.sendQty = $scope.sampleItem.sampleSend.sendQty; // 判断是否需要多次送样
+      var files = form.attachFile.$viewValue, file = files && files.length > 0 ? files[0] : null;
+      $upload.upload({
+        url: b2bUrl + 'sale/sample/' + $scope.sampleItem.id + '/send',
+        method: 'POST',
+        file: file,
+        data: {
+          json: $scope.sampleItem.sampleSend
+        }
+      }).success(function (data) {
+        $scope.loading = false;
+        $modalInstance.close('success');
+      }).error(function (data) {
+        $scope.loading = false;
+        toaster.pop('error', '错误', data);
+      });
+    };
+
+    $scope.cancel = function () {
+      $modalInstance.dismiss(sampleItem);
+    };
+
+    //设置单个单据已读
+    $scope.setOrdersRead = function (id) {
+      var sourceId = [];
+      sourceId.push(id);
+      PurcSample.setRead({}, sourceId, function (message) {
+        // $scope.getUnreadIds();
+      });
+    };
+  }]);
+
+})

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/saleChangeCtrl.js

@@ -183,7 +183,7 @@ define(['app/app'], function (app) {
     $scope.exportXls = function () {
       PurcChange.exportXls({}, {}, function (data) {
         if (data.success){
-          window.location.href = b2bPath + '/sale/changes/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+          window.location.href = BaseService.getB2bUrl() + '/sale/changes/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
         }
       }, function (response) {
         toaster.pop('error', '数据加载失败', response.data);

+ 3 - 3
src/main/webapp/resources/js/vendor/controllers/b2b/saleInquiryCtrl.js

@@ -358,7 +358,7 @@ define(['app/app'], function (app) {
                 if (withSteps) { // 保存并报价
                     if(null != file) {
                         $upload.upload({
-                            url: 'sale/inquiry/addAttach',
+                            url: BaseService.getB2bUrl() + '/sale/inquiry/addAttach',
                             file: file,
                             method: 'POST',
                             data: {
@@ -389,7 +389,7 @@ define(['app/app'], function (app) {
                 } else {  // 保存
                     if(null != file) {
                         $upload.upload({
-                            url: 'sale/inquiry/addAttach',
+                            url: BaseService.getB2bUrl() + '/sale/inquiry/addAttach',
                             file: file,
                             method: 'POST',
                             data: {
@@ -482,7 +482,7 @@ define(['app/app'], function (app) {
         $scope.exportXls = function () {
             PurcInquiry.exportXls({}, {}, function (data) {
                 if (data.success) {
-                    window.location.href = 'sale/inquiry/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+                    window.location.href = BaseService.getB2bUrl() + '/sale/inquiry/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
                 }
             }, function (response) {
                 toaster.pop('error', '数据加载失败', response.data);

+ 5 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/saleInquiryMouldCtrl.js

@@ -436,11 +436,15 @@ define(['app/app'], function (app) {
         $scope.exportXls = function () {
             PurcInquiryMould.exportXls({}, {}, function (data) {
                 if (data.success){
-                    window.location.href = 'sale/mould/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+                    window.location.href = BaseService.getB2bUrl() + '/sale/mould/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
                 }
             }, function (response) {
                 toaster.pop('error', '数据加载失败', response.data);
             });
         }
+
+        $scope.downFile = function(id) {
+          window.location.href = BaseService.getB2bUrl() + '/file/' + id
+        }
     }]);
 });

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/saleMakechangeCtrl.js

@@ -154,7 +154,7 @@ define(['app/app'], function (app) {
           $scope.exportXls = function () {
             MakeChange.exportXls({}, {}, function (data) {
               if (data.success) {
-                window.location.href = 'make/changes/xls?_state='
+                window.location.href =  BaseService.getB2bUrl() +'/make/changes/xls?_state='
                     + $scope.active + '&searchFilter=' + encodeURIComponent(
                         angular.toJson($scope.searchFilterXls));
               }

+ 3 - 3
src/main/webapp/resources/js/vendor/controllers/b2b/saleMaketodoCtrl.js

@@ -4,8 +4,8 @@
  */
 define(['app/app'], function (app) {
     "use strict";
-    app.register.controller('saleMaketodoCtrl', ['$rootScope','$scope', '$filter', 'B2bMakeOrder', 'ngTableParams', 'toaster', 'B2bReportService', 'BaseService', 'B2bSearchFilter', '$http', 'B2bCurrentRole',
-        function ($rootScope, $scope, $filter, MakeOrder, ngTableParams, toaster, ReportService, BaseService, SearchFilter, $http, B2bCurrentRole) {
+    app.register.controller('saleMaketodoCtrl', ['BaseService', '$rootScope','$scope', '$filter', 'B2bMakeOrder', 'ngTableParams', 'toaster', 'B2bReportService', 'BaseService', 'B2bSearchFilter', '$http', 'B2bCurrentRole',
+        function (BaseService, $rootScope, $scope, $filter, MakeOrder, ngTableParams, toaster, ReportService, BaseService, SearchFilter, $http, B2bCurrentRole) {
           $rootScope.active = 'vendor_order'
           $scope.tab = 'maketodo'
             var b2bUrl = BaseService.getB2bUrl()
@@ -336,7 +336,7 @@ define(['app/app'], function (app) {
             $scope.exportXls = function () {
                 MakeOrder.exportXls({}, {}, function (data) {
                     if (data.success){
-                        window.location.href = 'make/orders/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+                        window.location.href = BaseService.getB2bUrl() + '/make/orders/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
                     }
                 }, function (response) {
                     toaster.pop('error', '数据加载失败', response.data);

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/saleNoticeCtrl.js

@@ -405,7 +405,7 @@ define(['app/app'], function (app) {
     $scope.exportXls = function () {
       PurcNotice.exportXls({}, {}, function (data) {
         if (data.success){
-          window.location.href = 'sale/notice/xls?_state='+$scope.active+
+          window.location.href = BaseService.getB2bUrl() + '/sale/notice/xls?_state='+$scope.active+
               '&keyword='+($scope.keywordXls || '')+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
         }
       }, function (response) {

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/saleOrderCtrl.js

@@ -352,7 +352,7 @@ define(['app/app'], function (app) {
       $scope.exportXls = function () {
         PurcOrderItem.exportXls({}, {}, function (data) {
           if (data.success){
-            window.location.href = 'sale/orders/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+            window.location.href =  BaseService.getB2bUrl() +'/sale/orders/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
           }
         }, function (response) {
           toaster.pop('error', '数据加载失败', response.data);

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/saleQuotationListCtrl.js

@@ -230,7 +230,7 @@ define(['app/app'], function (app) {
         $scope.exportXls = function () {
             Quotation.exportXls({}, {}, function (data) {
                 if (data.success){
-                    window.location.href = 'sale/quotation/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+                    window.location.href = BaseService.getB2bUrl() + '/sale/quotation/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
                 }
             }, function (response) {
                 toaster.pop('error', '数据加载失败', response.data);

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/saleSendCtrl.js

@@ -121,7 +121,7 @@ define(['app/app'], function (app) {
     $scope.exportXls = function () {
       SaleSend.exportXls({}, {}, function (data) {
         if (data.success){
-          window.location.href = 'sale/notice/sends/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || '')+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+          window.location.href = BaseService.getB2bUrl() + '/sale/notice/sends/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || '')+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
         }
       }, function (response) {
         toaster.pop('error', '数据加载失败', response.data);

+ 14 - 4
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js

@@ -1840,7 +1840,7 @@ define(['app/app'], function (app) {
                 };
             }]);
 //角色管理-编辑角色controller
-    app.register.controller('RoleEditCtrl', ['$scope', '$modalInstance', '$timeout', 'AccountResource', 'AccountRole', 'toaster', 'role', 'BaseService', function ($scope, $modalInstance, $timeout, AccountResource, AccountRole, toaster, role, BaseService) {
+    app.register.controller('RoleEditCtrl', ['$scope', '$modalInstance', '$timeout', 'AccountResource', 'AccountRole', 'toaster', 'role', 'BaseService', 'isB2b', 'B2bAccountResource', 'B2bAccountRole', function ($scope, $modalInstance, $timeout, AccountResource, AccountRole, toaster, role, BaseService, isB2b, B2bAccountResource, B2bAccountRole) {
         BaseService.scrollBackToTop();
         $scope.role = angular.copy(role || {});
         $scope.master = angular.copy($scope.role);
@@ -1875,8 +1875,18 @@ define(['app/app'], function (app) {
                 });
             }
         }
+        var getB2bResource = function () {
+            return isB2b ? {
+                AccountResource: B2bAccountResource,
+                AccountRole: B2bAccountRole
+            } : {
+                AccountResource: AccountResource,
+                AccountRole: AccountRole
+            }
+        }
+        var queryObj = getB2bResource();
 
-        AccountResource.query({}, function (data) {
+        queryObj.AccountResource.query({}, function (data) {
             if (data && data.length > 0) {
                 var rs = [];// 已分配的资源的id
                 if (role && role.resourceItems) {
@@ -2031,7 +2041,7 @@ define(['app/app'], function (app) {
             if (!$scope.master.color || $scope.master.color == '') {
                 $scope.master.color = parseInt(Math.random() * 5) + 1 + '';
             }
-            AccountRole.save($scope.master, function () {
+            queryObj.AccountRole.save($scope.master, function () {
                 toaster.pop('success', '提示', '角色:' + $scope.role.desc + ' 资料' + (isNew ? '添加' : '修改') + '成功');
                 $modalInstance.close(true);
             }, function (response) {
@@ -2040,7 +2050,7 @@ define(['app/app'], function (app) {
         };
         $scope.del = function () {
             if (confirm('确定删除角色(' + $scope.role.desc + ')吗?')) {
-                AccountRole.remove({id: role.id}, function () {
+                queryObj.AccountRole.remove({id: role.id}, function () {
                     toaster.pop('success', '提示', '角色:' + $scope.role.desc + ' 删除成功');
                     $modalInstance.close(true);
                 }, function (response) {

+ 26 - 1
src/main/webapp/resources/view/sso/b2b/customersInfo.html

@@ -146,6 +146,28 @@
 		border: solid 1px #5078cb;
 		color: #ffffff !important ;
 	}
+	.ng-table-pager::after {
+		clear: both;
+		content: ' ';
+		zoom: 1;
+		display: block;
+		visibility: hidden;
+	}
+	.ng-table-pager {
+		padding-right: 20px;
+		padding-top: 50px;
+		margin-right: 0 !important;
+	}
+	.text-mns {
+		padding-right: 15px;
+		position: absolute;
+		bottom: 64px;
+		right: 20px;
+		font-size: 12px;
+	}
+	.Boom18 {
+		bottom: 18px;
+	}
 </style>
 <link rel="stylesheet" href="static/css/b2bPublic.css">
 <div style="background: #fff;" id="myquest-public" class="block fr">
@@ -174,7 +196,7 @@
                 </div>
             </div>
         </form>-->
-		<div class="pane-body">
+		<div class="pane-body" style="position: relative">
 			<table class="customer-tab table table-bordered table-striped table-hover"
 				   ng-table="customerParams">
 				<tbody ng-repeat="customer in $data" ng-if="customerParams.total() > 0">
@@ -233,6 +255,9 @@
 				</tr>
 				</tbody>
 			</table>
+			<div ng-if="infoCommon.totalElement > 0" class="text-mns text-right" ng-class="infoCommon.totalElement >= 20 ? '': 'Boom18'">
+				显示&nbsp;{{(infoCommon .page - 1 ) * infoCommon.size + 1}}-{{infoCommon.all >= 20 ? infoCommon.page *  infoCommon.size: (infoCommon.page - 1 ) * infoCommon.size + infoCommon.all}}&nbsp;条,共&nbsp;{{infoCommon.totalElement}}&nbsp;条
+			</div>
 		</div>
 	</div>
 </div>

+ 45 - 0
src/main/webapp/resources/view/sso/b2b/modal/add_vendor.html

@@ -0,0 +1,45 @@
+<style>
+	.modal-content {
+		max-height: 500px;
+		overflow-y: auto;
+	}
+</style>
+<div class="b2b-com-modal b2b-operate-modal">
+	<p class="title">
+		分配企业权限 <i class="fa fa-close" ng-click="close(false)"></i>
+	</p>
+	<table width="100%" class="table b2b-modal-table">
+		<thead>
+		<th width="100px;">客户名称</th>
+		<th width="80px;">客户UU</th>
+		<th width="40px;" style="text-align: center">
+			<label class="com-check-box">
+				<input type="checkbox" id="All" name="checkbox" ng-model="checkboxes.checked" ng-click="checkAll()">
+				<label for="All"></label>
+			</label>
+		</th>
+		</thead>
+		<tbody>
+		<div style="overflow-y:scroll; width:100%;max-height:500px">
+			<tr ng-repeat="vendor in enters track by $index">
+				<td width="100px;">{{vendor.myEnterprise.enName}}</td>
+				<td width="80px;">{{vendor.myEnterprise.uu}}</td>
+				<td width="40px;" style="text-align: center">
+					<label class="com-check-box">
+						<input id="{{$index}}" ng-model="vendor.distribute" name="checkbox" ng-click="checkOne(vendor)" type="checkbox">
+						<label for="{{$index}}"></label>
+					</label>
+				</td>
+			</tr>
+			<div ng-if="enters.length == 0" class="warningLg">
+				此账号客户已全部被分配,请返回!
+			</div>
+		</div>
+		<tbody>
+	</table>
+	<div class="operate text-center">
+		<p class="text-left" style="color: #999;padding-left: 20px"><i class="must">*</i>点击企业选中或取消</p>
+		<button class="b2b-btn b2b-btn-submit" ng-click="close(true)">确认</button>
+		<button class="b2b-btn b2b-btn-cancel" ng-click="close(false)" type="button">取消</button>
+	</div>
+</div>

+ 25 - 1
src/main/webapp/resources/view/sso/b2b/myRequest.html

@@ -390,9 +390,30 @@
 	}
 	.order-table .order-hd.height72{
 		background: #fff !important ;
+	}.ng-table-pager::after {
+		 clear: both;
+		 content: ' ';
+		 zoom: 1;
+		 display: block;
+		 visibility: hidden;
+	 }
+	.ng-table-pager {
+		padding-right: 20px;
+		padding-top: 50px;
+		margin-right: 0 !important;
+	}
+	.text-mns {
+		padding-right: 15px;
+		position: absolute;
+		bottom: 64px;
+		right: 20px;
+		font-size: 12px;
+	}
+	.Boom18 {
+		bottom: 18px;
 	}
 </style>
-<div class="block fr" id="myquest-public">
+<div class="block fr" id="myquest-public" style="position: relative">
 	<div ng-include src="'static/view/sso/b2b/vendorAndCustomer.html'"></div>
 	<div>
 		<div class="search">
@@ -473,5 +494,8 @@
 			</td>
 		</tr>
 		</tbody>
+		<div ng-if="infoCommon.totalElement > 0" class="text-mns text-right" ng-class="infoCommon.totalElement >= 20 ? '': 'Boom18'">
+			显示&nbsp;{{(infoCommon .page - 1 ) * infoCommon.size + 1}}-{{infoCommon.all >= 20 ? infoCommon.page *  infoCommon.size: (infoCommon.page - 1 ) * infoCommon.size + infoCommon.all}}&nbsp;条,共&nbsp;{{infoCommon.totalElement}}&nbsp;条
+		</div>
 	</table>
 </div>

+ 26 - 1
src/main/webapp/resources/view/sso/b2b/newPartner.html

@@ -338,8 +338,30 @@
 		width:1026px;
 		margin: 0 auto;
 	}
+	.ng-table-pager::after {
+		clear: both;
+		content: ' ';
+		zoom: 1;
+		display: block;
+		visibility: hidden;
+	}
+	.ng-table-pager {
+		padding-right: 20px;
+		padding-top: 50px;
+		margin-right: 0 !important;
+	}
+	.text-mns {
+		padding-right: 15px;
+		position: absolute;
+		bottom: 64px;
+		right: 20px;
+		font-size: 12px;
+	}
+	.Boom18 {
+		bottom: 18px;
+	}
 </style>
-<div class="block fr" id="myquest-public">
+<div class="block fr" id="myquest-public" style="position: relative">
 	<div class="loading in" ng-class="{'in': loading}">
 		<!--<i></i>-->
 		<div class="wrap">
@@ -444,4 +466,7 @@
 		</tr>
 		</tbody>
 	</table>
+	<!--<div ng-if="infoCommon.totalElement > 0" class="text-mns text-right" ng-class="infoCommon.totalElement >= 20 ? '': 'Boom18'">-->
+		<!--显示&nbsp;{{(infoCommon .page - 1 ) * infoCommon.size + 1}}-{{infoCommon.all >= 20 ? infoCommon.page *  infoCommon.size: (infoCommon.page - 1 ) * infoCommon.size + infoCommon.all}}&nbsp;条,共&nbsp;{{infoCommon.totalElement}}&nbsp;条-->
+	<!--</div>-->
 </div>

+ 26 - 1
src/main/webapp/resources/view/sso/b2b/servicerInfo.html

@@ -163,6 +163,28 @@
 		border: solid 1px #5078cb;
 		color: #ffffff !important ;
 	}
+	.ng-table-pager::after {
+		clear: both;
+		content: ' ';
+		zoom: 1;
+		display: block;
+		visibility: hidden;
+	}
+	.ng-table-pager {
+		padding-right: 20px;
+		padding-top: 50px;
+		margin-right: 0 !important;
+	}
+	.text-mns {
+		padding-right: 15px;
+		position: absolute;
+		bottom: 64px;
+		right: 20px;
+		font-size: 12px;
+	}
+	.Boom18 {
+		bottom: 18px;
+	}
 </style>
 <link rel="stylesheet" href="static/css/b2bPublic.css">
 <div style="background: #fff;" id="myquest-public" class="block fr">
@@ -195,7 +217,7 @@
 		</div>
 	</div>
 	<div class="wrap-contnet" id="customer-tab">
-		<div class="content">
+		<div class="content" style="position: relative">
 			<!--供应商列表-->
 			<table class="table  table-hover customer-tab" ng-table="customerParams">
 				<tbody ng-repeat="vendor in $data">
@@ -252,6 +274,9 @@
 				</tr>
 				</tbody>
 			</table>
+			<div ng-if="infoCommon.totalElement > 0" class="text-mns text-right" ng-class="infoCommon.totalElement >= 20 ? '': 'Boom18'">
+				显示&nbsp;{{(infoCommon .page - 1 ) * infoCommon.size + 1}}-{{infoCommon.all >= 20 ? infoCommon.page *  infoCommon.size: (infoCommon.page - 1 ) * infoCommon.size + infoCommon.all}}&nbsp;条,共&nbsp;{{infoCommon.totalElement}}&nbsp;条
+			</div>
 		</div>
 	</div>
 </div>

+ 26 - 2
src/main/webapp/resources/view/sso/b2b/vendorsInfo.html

@@ -163,7 +163,28 @@
 		border: solid 1px #5078cb;
 		color: #ffffff !important ;
 	}
-
+	.ng-table-pager::after {
+		clear: both;
+		content: ' ';
+		zoom: 1;
+		display: block;
+		visibility: hidden;
+	}
+	.ng-table-pager {
+		padding-right: 20px;
+		padding-top: 50px;
+		margin-right: 0 !important;
+	}
+	.text-mns {
+		padding-right: 15px;
+		position: absolute;
+		bottom: 64px;
+		right: 20px;
+		font-size: 12px;
+	}
+	.Boom18 {
+		bottom: 18px;
+	}
 </style>
 <div style="background: #fff;" id="myquest-public" class="block fr">
 	<div ng-include src="'static/view/sso/b2b/vendorAndCustomer.html'"></div>
@@ -195,7 +216,7 @@
 			</div>
 		</div>
 	</div>
-	<div class="wrap-content" id="customer-tab">
+	<div class="wrap-content" id="customer-tab"  style="position: relative">
 		<div class="content">
 			<!--供应商列表-->
 			<table class="table order-table table-hover customer-tab" ng-table="customerParams">
@@ -255,6 +276,9 @@
 				</tr>
 				</tbody>
 			</table>
+			<div ng-if="infoCommon.totalElement > 0" class="text-mns text-right" ng-class="infoCommon.totalElement >= 20 ? '': 'Boom18'">
+				显示&nbsp;{{(infoCommon .page - 1 ) * infoCommon.size + 1}}-{{infoCommon.all >= 20 ? infoCommon.page *  infoCommon.size: (infoCommon.page - 1 ) * infoCommon.size + infoCommon.all}}&nbsp;条,共&nbsp;{{infoCommon.totalElement}}&nbsp;条
+			</div>
 		</div>
 	</div>
 </div>

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

@@ -904,9 +904,14 @@
 </style>
 <!--右侧主体部分-->
 <div class="count user_right fr" ng-click="hideList()">
+    <div class="tab_top" style="margin-bottom: 16px;">
+        <ul>
+            <li ng-class="{active: tab == 'b2c'}" ng-click="setTab('b2c')"><a href="javascript:void(0)">商城角色</a></li>
+            <li ng-class="{active: tab == 'b2b'}" ng-click="setTab('b2b')"><a href="javascript:void(0)">b2b角色</a></li>
+        </ul>
+    </div>
     <!--安全设置-->
     <div class="count_center">
-        <div class="rt_menu"><span>角色权限</span></div>
         <!-- 角色管理 -->
         <div class="count01 clearfix role-manage" >
             <p>默认角色</p>

+ 17 - 6
src/main/webapp/resources/view/sso/staffManagement.html

@@ -350,6 +350,8 @@
     .auth-info-area .role-info tr td.edit-btn-area a, .auth-info-area .role-info tr td.edit-btn-area span{
         color: #5078cb;
         cursor: pointer;
+        display: block;
+        line-height: 26px;
     }
     .auth-info-header {
         height: 40px;
@@ -963,7 +965,8 @@
                         <th width="67">性别</th>
                         <th width="133">手机</th>
                         <th width="207">邮箱</th>
-                        <th width="376">角色</th>
+                        <th width="188">商城角色</th>
+                        <th width="188">b2b角色</th>
                         <th width="107">操作</th>
                     </tr>
                     </thead>
@@ -1020,16 +1023,24 @@
                             <span ng-repeat="role in user.roles track by $index" ng-if="$index < 6 || user.roles.length == 7" class="role-tag bgcolor-{{role.color || 1}}">{{role.desc.substring(0,1)}}</span>
                             <span class="role-tag bgcolor-6" ng-if="user.roles.length > 7">...</span>
                         </td>
+                        <td class="role-tag-area detail-role-tag">
+                            <span ng-repeat="role in user.b2bRoles track by $index" ng-if="$index < 6 || user.roles.length == 7" class="role-tag bgcolor-{{role.color || 1}}">{{role.desc.substring(0,1)}}</span>
+                            <span class="role-tag bgcolor-6" ng-if="user.roles.length > 7">...</span>
+                        </td>
                         <!--<td class="edit-btn-area">
                             <a>编辑 </a><span>|</span><a> 删除</a>
                         </td>-->
                         <td class="edit-btn-area">
                             <!--<a class="operator-trigger" href="javascript:void(0);"><i class="fa fa-pencil fa-lg" ng-show="(userInfo.sys && enterprise.enAdminuu != user.userUU) || users.length == 1"></i></a>-->
-                            <div>  <!--&& enterprise.enAdminuu != user.userUU-->
-                                <span ng-click="editUserRole(user)" ng-show="user.userUU != userInfo.userUU" title="角色分配"><i></i>角色分配 | </span>
-                                <span ng-click="setShowDelUserFlag(true, user)" ng-show="user.userUU != userInfo.userUU" title="删除"><i></i>删除</span>
-                                <span ng-show="user.userUU == userInfo.userUU" disabled="false" title="角色分配" style="color: #606168; cursor: not-allowed;"><i></i>角色分配 | </span>
-                                <span ng-show="user.userUU == userInfo.userUU" disabled="false" title="删除" style="color: #606168; cursor: not-allowed;"><i></i>删除</span>
+                            <div ng-if="user.userUU != userInfo.userUU">  <!--&& enterprise.enAdminuu != user.userUU-->
+                                <span ng-click="addVendor(user)" title="客户分配">b2b客户分配</span>
+                                <span ng-click="editUserRole(user)" title="角色分配"><i></i>角色分配</span>
+                                <span ng-click="setShowDelUserFlag(true, user)" title="删除"><i></i>删除</span>
+                            </div>
+                            <div ng-if="user.userUU == userInfo.userUU">
+                                <span disabled="false" title="客户分配" style="color: #606168; cursor: not-allowed;"><i></i>b2b客户分配</span>
+                                <span disabled="false" title="角色分配" style="color: #606168; cursor: not-allowed;"><i></i>角色分配</span>
+                                <span disabled="false" title="删除" style="color: #606168; cursor: not-allowed;"><i></i>删除</span>
                             </div>
                         </td>
                     </tr>

+ 38 - 37
src/main/webapp/resources/view/vendor/b2b/change/sale_inquiry_mould_detail.html

@@ -467,42 +467,43 @@
         </td>
       </table>
     </div>
-  </div>
-</div>
-<div ng-if="inquiryMould.status == 200 && inquiryMould.overdue != 1 && inquiryMould.adoptStatus == null && inquiryMould.valid != 0">
-  <div class="text-center btn-items" ng-show="!inquiryMould.$editing">
-    <button class="btn btn-success btn-items"
-            ng-click="inquiryMould.$editing=!inquiryMould.$editing">
-      报价
-    </button>
-  </div>
-  <div class="text-center btn-items" ng-show="inquiryMould.$editing">
-    <button ng-click="onReplyClick(inquiryMould, true)"
-            class="btn btn-danger btn-items">
-      保存并确认报价
-    </button>
-    <button ng-click="onReplyClick(inquiryMould)"
-            ng-disabled="!canSave"
-            class="btn btn-success btn-items">保存</button>
-    <button class="btn btn-items"
-            ng-click="inquiryMould.$editing=!inquiryMould.$editing;reload()">取消</button>
-  </div>
-</div>
-<div ng-if="inquiryMould.replyable && inquiryMould.status == 201 && inquiryMould.adoptStatus == null && inquiryMould.checked != 1  && inquiryMould.valid != 0" style="padding-top: 20px;">
-  <div class="text-center btn-items" ng-show="!inquiryMould.$editing">
-    <button class="btn btn-success" ng-click="inquiryMould.$editing=!inquiryMould.$editing;  getToken()">修改报价</button>
-  </div>
-  <div class="text-center" ng-show="inquiryMould.$editing">
-    <button ng-click="onReplyClick(inquiryMould, true)"
-            ng-disabled="!canSave"
-            class="btn btn-danger btn-items">
-      保存并确认报价
-    </button>
-    <botton class="btn btn-success btn-items" ng-disabled="!canSave"
-            ng-click="onReplyClick(inquiryMould)">
-      保存
-    </botton>
-    <button class="btn btn-items"
-            ng-click="inquiryMould.$editing=!inquiryMould.$editing;reload()">取消</button>
+    <div ng-if="inquiryMould.status == 200 && inquiryMould.overdue != 1 && inquiryMould.adoptStatus == null && inquiryMould.valid != 0">
+      <div class="text-center btn-items" ng-show="!inquiryMould.$editing">
+        <button class="btn btn-success btn-items"
+                ng-click="inquiryMould.$editing=!inquiryMould.$editing">
+          报价
+        </button>
+      </div>
+      <div class="text-center btn-items" ng-show="inquiryMould.$editing">
+        <button ng-click="onReplyClick(inquiryMould, true)"
+                class="btn btn-danger btn-items">
+          保存并确认报价
+        </button>
+        <button ng-click="onReplyClick(inquiryMould)"
+                ng-disabled="!canSave"
+                class="btn btn-success btn-items">保存</button>
+        <button class="btn btn-items"
+                ng-click="inquiryMould.$editing=!inquiryMould.$editing;reload()">取消</button>
+      </div>
+    </div>
+    <div ng-if="inquiryMould.replyable && inquiryMould.status == 201 && inquiryMould.adoptStatus == null && inquiryMould.checked != 1  && inquiryMould.valid != 0" style="padding-top: 20px;">
+      <div class="text-center btn-items" ng-show="!inquiryMould.$editing">
+        <button class="btn btn-success" ng-click="inquiryMould.$editing=!inquiryMould.$editing;  getToken()">修改报价</button>
+      </div>
+      <div class="text-center" ng-show="inquiryMould.$editing">
+        <button ng-click="onReplyClick(inquiryMould, true)"
+                ng-disabled="!canSave"
+                class="btn btn-danger btn-items">
+          保存并确认报价
+        </button>
+        <botton class="btn btn-success btn-items" ng-disabled="!canSave"
+                ng-click="onReplyClick(inquiryMould)">
+          保存
+        </botton>
+        <button class="btn btn-items"
+                ng-click="inquiryMould.$editing=!inquiryMould.$editing;reload()">取消</button>
+      </div>
+    </div>
+
   </div>
 </div>

+ 193 - 0
src/main/webapp/resources/view/vendor/b2b/modal/sample_send.html

@@ -0,0 +1,193 @@
+<style>
+	.sampleSend label{
+		font-weight: inherit;
+	}
+	.modal-body .row{
+		line-height: 34px;
+	}
+	.modal-content{
+		width: 720px;
+	}
+	.sampleSend .modal-body .row{
+		margin: 0;
+		line-height: 34px;
+		margin-bottom: 10px;
+	}
+	.sampleSend .modal-body .row .form-control{
+		height: 34px;
+		border: #bfbfbf 1px solid;
+		font-size: 14px;
+	}
+	.input-group-addon{
+		width: 60px;
+		padding: 0;
+		font-size: 12px;
+		background: #fff;
+	}
+	.input-group[class*="col-"]{
+		float: left;
+	}
+	.modal-footer{
+		border-top: none;
+		border-top: none;
+		margin-right: 18px;
+		padding: 0 15px 15px;
+	}
+	.sampleSend .col {
+		padding-left: 5px;
+		padding-right: 5px;
+		line-height: 30px;
+	}
+</style>
+<div class="loading" ng-class="{'in': loading}">
+	<!--<i></i>-->
+	<div class="wrap">
+		<div class="outer"></div>
+	</div>
+</div>
+<div class="modal-header">
+	<h3 class="modal-title">送样</h3>
+</div>
+<form class="sampleSend" name="sampleSendForm"
+	ng-submit="ok(sampleSendForm)" novalidate>
+	<div class="modal-body" style="min-height: 500px;padding: 25px 25px 10px 25px;">
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">客户:</label>
+			<div class="col-md-4 col-sm-4 col">{{sampleItem.proofing.enterprise.enName}}</div>
+			<label class="col-md-2 col-sm-2 col">最小订购量:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input ng-model="sampleItem.sampleSend.minBuyQty" placeholder="整数"
+					   class="form-control input-sm" type="number"> <span
+					style="width: 30px;" class="input-group-addon">{{sampleItem.proofing.product.unit}}</span>
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">物料:</label>
+			<div class="col-md-4 col-sm-4 col">{{sampleItem.proofing.product.title}}</div>
+			<label class="col-md-2 col-sm-2 col">最小包装量:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input ng-model="sampleItem.sampleSend.minQty" placeholder="整数"
+					   class="form-control input-sm" type="number"> <span
+					style="width: 30px;" class="input-group-addon">{{sampleItem.proofing.product.unit}}</span>
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">规格:</label>
+			<div class="col-md-4 col-sm-4 col">{{sampleItem.proofing.product.spec}}</div>
+			<label class="col-md-2 col-sm-2 col">生产厂型号:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.vendSpec"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">单位:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.unit"
+					   class="form-control input-sm" type="text">
+			</div>
+			<label class="col-md-2 col-sm-2 col">品牌:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.brand"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col"><strong
+					class="text-inverse">*</strong>数量:</label>
+			<div class="col-md-4 col-sm-4 col input-group"
+				 ng-init="sampleItem.sampleSend.sendQty = sampleItem.qty - (sampleItem.sendQty || 0)">
+				<input ng-model="sampleItem.sampleSend.sendQty" required placeholder="必填,整数"
+					   class="form-control input-sm" type="number"
+					   max="{{sampleItem.qty - (sampleItem.sendQty || 0)}}" min="0"> <span
+					style="width: 30px;" class="input-group-addon">{{sampleItem.proofing.product.unit}}</span>
+			</div>
+			<label class="col-md-2 col-sm-2 col">单重:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input ng-model="sampleItem.sampleSend.weight" placeholder="仅限整数或小数"
+					   class="form-control input-sm" type="text"
+					   ng-pattern="/^\d*\.{0,1}\d*$/"> <span
+					style="width: 30px;" class="input-group-addon">g</span>
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col"><strong
+					class="text-inverse">*</strong>送样单号:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.code"
+					   class="form-control input-sm" type="text" required placeholder="必填">
+			</div>
+			<label class="col-md-2 col-sm-2 col">材料:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.material"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">币别:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<select class="form-control" ng-model="sampleItem.currency" ng-init="sampleItem.currency">
+					<option value="RMB">RMB</option>
+					<option value="USD">USD</option>
+					<option value="HKD">HKD</option>
+				</select>
+			</div>
+			<label class="col-md-2 col-sm-2 col">材质:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.materialQuality"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">税率:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input class="form-control input-sm" type="text" ng-model="sampleItem.taxrate" ng-init="sampleItem.taxrate" ng-pattern="/^\d{1,2}$/">
+				<span style="width: 30px;" class="input-group-addon">%</span>
+			</div>
+			<label class="col-md-2 col-sm-2 col">产地:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.adress"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">采购单价:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.puprice"
+					   class="form-control input-sm" type="text" placeholder="仅限整数或小数"
+					   ng-pattern="/^\d*\.{0,1}\d*$/">
+			</div>
+			<label class="col-md-2 col-sm-2 col">产地识别:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.addressMark"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">交货周期:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input ng-model="sampleItem.sampleSend.delivery" placeholder="整数"
+					   class="form-control input-sm" type="number"> <span
+					style="width: 30px;" class="input-group-addon">天</span>
+			</div>
+			<label class="col-md-2 col-sm-2 col">口水料比例:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input ng-model="sampleItem.sampleSend.ratio"
+					   class="form-control input-sm" type="number" placeholder="整数">
+				<span style="width: 30px;" class="input-group-addon">%</span>
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">附件:</label>
+			<div class="col-md-10 col-sm-10 col">
+				<input type="file" ng-model="attachFile" ng-file-select
+					ng-multiple="false" class="form-control input-sm" name="attachFile"
+					id="attachFile">
+			</div>
+		</div>
+	</div>
+	<div class="modal-footer">
+		<button class="btn btn-primary" type="submit" ng-disabled="sampleSendForm.$invalid" ng-click="setOrdersRead(sampleItem.id)">确认送样</button>
+		<button class="btn btn-warning" ng-click="cancel()" type="button">取消</button>
+	</div>
+</form>

+ 579 - 0
src/main/webapp/resources/view/vendor/b2b/sale/approval.html

@@ -0,0 +1,579 @@
+<style>
+  .order-table .header>th {
+    height: 38px;
+    text-align: center;
+    /*background: #f5f5f5;*/
+    border-top: 1px solid #e8e8e8;
+    border-bottom: 1px solid #e8e8e8;
+  }
+
+  .order-table .sep-row {
+    height: 10px;
+  }
+
+  .order-table .selector {
+    vertical-align: middle;
+    margin: 0 0 2px 0;
+  }
+
+  .toolbar label {
+    margin-right: 10px;
+    margin-bottom: 0;
+  }
+
+  .toolbar .select_all {
+    margin: 0 6px 0 10px;
+    line-height: 20px;
+  }
+
+  .toolbar .btn {
+    -moz-border-radius: 2px;
+    margin-right: 5px;
+    border: 1px solid #dcdcdc;
+    border-radius: 2px;
+    -webkit-border-radius: 2px;
+  }
+
+  .order-table .order-hd {
+    background: #f5f5f5;
+    height: 40px;
+    line-height: 40px;
+  }
+
+  .order-table .order-hd td.first {
+    padding-left: 20px;
+  }
+
+  .order-table .order-hd .order-main span {
+    margin-right: 8px;
+  }
+
+  .order-table .order-hd .order-code {
+    font-style: normal;
+    font-family: verdana;
+  }
+
+  .order-table .order-hd .order-sum {
+    padding: 0 5px;
+  }
+
+  .order-table>tbody {
+    border: 1px solid transparent;
+  }
+
+  .order-table>tbody:hover {
+    border-color: #56a022;
+    border-width: 2px;
+  }
+
+  .order-table .operates {
+    display: none;
+  }
+
+  .order-table>tbody:hover .operates {
+    display: block;
+  }
+
+  .order-table .order-bd {
+    border-bottom: 1px solid #e6e6e6;
+  }
+
+  .order-table .order-bd>td {
+    padding: 10px 5px;
+    vertical-align: top;
+    position: relative;
+  }
+
+  .order-table .order-bd .product {
+    padding-left: 20px;
+  }
+
+  .input-xs, .input-group-xs>.form-control, .input-group-xs>.input-group-addon,
+  .input-group-xs>.input-group-btn>.btn {
+    height: 26px;
+    padding: 0 5px;
+    font-size: 12px;
+    line-height: 1.5;
+    border-radius: 3px;
+  }
+
+  .input-group-xs .form-control:last-child, .input-group-addon:last-child,
+  .input-group-btn:first-child>.btn:not (:first-child ), .input-group-btn:last-child>.btn
+  {
+    border-top-left-radius: 0;
+    border-bottom-left-radius: 0;
+  }
+
+  .modal-dialog {
+    margin-top: 110px;
+  }
+
+  .sampleSend .col {
+    padding-left: 5px;
+    padding-right: 5px;
+    line-height: 30px;
+  }
+
+  .sampleSend label {
+    font-weight: bold;
+    text-align: right;
+    font-family: "Microsoft YaHei", "微软雅黑";
+    line-height: 30px;
+  }
+
+  .file {
+    color: #336699;
+    margin-right: 0;
+    text-align: left;
+    padding-left: 0;
+  }
+  .file a{
+    color: #3a89d1;
+  }
+  .label{
+    color:#fff !important;
+  }
+</style>
+<style>
+  .order-table {
+    background: #fff;
+    width: 100%;
+    /*margin-bottom: 10px;*/
+  }
+  .order-table thead tr {
+    background: #fff;
+  }
+  .order-table .header>th {
+    height: 38px;
+    text-align: center;
+    /*background: #f5f5f5;*/
+    border-top: 1px solid #e8e8e8;
+    /*border-bottom: 1px solid #e8e8e8;*/
+    font-size: 14px;
+  }
+
+  /*.order-table .sep-row {*/
+  /*height: 10px;*/
+  /*}*/
+
+  .order-table .selector {
+    vertical-align: middle;
+    margin: 0 0 2px 0;
+  }
+
+  .toolbar label {
+    margin-right: 10px;
+    margin-bottom: 0;
+  }
+
+  .toolbar .select_all {
+    margin: 0 6px 0 10px;
+    line-height: 20px;
+  }
+
+  .toolbar .btn {
+    -moz-border-radius: 2px;
+    margin-right: 5px;
+    border: 1px solid #dcdcdc;
+    border-radius: 2px;
+    -webkit-border-radius: 2px;
+  }
+
+  .order-table .order-hd {
+    /*background: #f5f5f5;*/
+    background: #f9f9f9;
+    height: 40px;
+    line-height: 40px;
+  }
+
+  .order-table .order-hd td.first {
+    padding-left: 20px;
+  }
+
+  .order-table .order-hd .order-main span {
+    margin-right: 8px;
+  }
+
+  .order-table .order-hd .order-code {
+    font-style: normal;
+    font-family: verdana;
+  }
+
+  .order-table .order-hd .order-sum {
+    padding: 0 5px;
+  }
+
+  .order-table .order-info {
+    padding-left: 20px;
+  }
+
+  .order-table>tbody {
+    border: 1px solid #e8e8e8;
+  }
+
+  .order-table>tbody:hover {
+    border-color: #3f84f6;
+    border-width: 2px;
+  }
+
+  .order-table>tbody:hover tr.order-bd {
+    background:#f8fafe
+  }
+  .order-table .operates {
+    display: none;
+  }
+
+  .order-table>tbody:hover .operates {
+    display: block;
+  }
+
+  .order-table .order-bd {
+    border-top: 1px solid #e8e8e8;
+    /*border-bottom: 1px solid #e6e6e6;*/
+  }
+
+  .order-table .order-bd>td {
+    /*height: 140px;*/
+    vertical-align: middle;
+    position: relative;
+    padding: 25px 0;
+    border-right: 1px solid #e8e8e8;
+  }
+  .order-table .order-bd>td:nth-last-of-type(1) {
+    border-right: 0px
+  }
+
+  .order-table .order-bd .product {
+    padding-left: 31px;
+  }
+
+  .menu .new-dot{
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    font-size: 12px;
+    color: #fff;
+    font-weight: inherit;
+    top: -2px;
+  }
+  .screen .radio-block.date-radio {
+    width: auto
+  }
+  .order-table span,.order-table div {
+    font-size: 14px;
+    color: #333;
+  }
+  .clearfix::after {
+    clear:both;
+    zoom: 1;
+    content: ' ';
+    display: block;
+    visibility: hidden;
+  }
+  .order-table .order-bd .order-number {
+    position: absolute;
+    top: -1px;
+    left: -1px;
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    text-align: center;
+    background: #f9f9f9;
+    font-weight: 500;
+    border: solid 1px #d5d5d5;
+    border-radius: 0 0 10px 0;
+  }
+  .text-trans {
+    top: 22px;
+    right: 6px;
+  }
+  .oder{
+    /*background: #fff;*/
+    /*padding-bottom: 60px;*/
+    position: relative;
+  }
+  .ng-table-pager::after {
+    clear: both;
+    content: ' ';
+    zoom: 1;
+    display: block;
+    visibility: hidden;
+  }
+  .ng-table-pager {
+    padding-right: 20px;
+    padding-top: 50px;
+    margin-right: 0 !important;
+  }
+  .text-mns {
+    padding-right: 15px;
+    position: absolute;
+    bottom: 64px;
+    right: 20px;
+  }
+  .order-table>tbody:hover .operates-status {
+    display: none;
+  }
+  .Boom18 {
+    bottom: 18px
+  }
+</style>
+<div class="user_right fr" style="position: relative">
+  <div class="tab_top" style="margin-bottom: 10px">
+    <ul class="fl" style="width: 100%">
+      <li ng-class="{'active': storeType=='sample'}"><a ui-sref="sale_sample">客户打样申请</a></li>
+      <li ng-class="{'active': storeType=='approval'}"><a >客户认定单</a></li>
+      <li class="down-purchase" style="float:right;color: #5078cb;margin-right: 5px;"><span ng-click="exportXls()"><i class="fa fa-file-excel-o fa-fw"></i>导出Excel</span></li>
+    </ul>
+  </div>
+  <div class="oder01" style="margin-bottom: 0px">
+    <ul>
+      <li ng-class="{'active': active=='all'}" ng-click="setActive('all')"><a> 全部</a></li>
+      <li ng-class="{'active': active=='agreed'}" ng-click="setActive('agreed');"><a>合格</a></li>
+      <li ng-class="{'active': active=='refused'}" ng-click="setActive('refused')"><a>不合格</a></li>
+    </ul>
+  </div>
+  <div class="screen check-filter">
+    <div class="radio-block date-radio">
+      时间筛选:
+      <label class="com-check-radio">
+        <input type="radio" id="oneMonth" name="date" ng-click="autoMonth = false;changeDateZone(1);condition.$open=false" checked>
+        <label for="oneMonth"></label>
+        30天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="threeMonth" name="date" ng-click="autoMonth = false;changeDateZone(3);condition.$open=false">
+        <label for="threeMonth"></label>
+        90天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="sixMonth" name="date" ng-click="autoMonth = false;changeDateZone(6);condition.$open=false">
+        <label for="sixMonth"></label>
+        180天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="autoMonth" name="date" ng-click="autoMonth = true;condition.$open=!condition.$open;changeDateZone(-1)">
+        <label for="autoMonth"></label>
+        自定义
+      </label>
+    </div>
+    <div class="sreach fr">
+      <div ng-show="autoMonth" class="date fl">
+        <div class="data-input">
+          <input type="text" ng-model="condition.dateFrom"
+                 class="form-control select-adder" placeholder="起始时间"
+                 datepicker-popup="yyyy-MM-dd"
+                 is-open="condition.$fromOpened"
+                 max-date="condition.dateTo" current-text="今天" clear-text="清除" close-text="关闭"
+                 ng-click="openFilterDatePicker($event, condition, '$fromOpened')"
+                 ng-focus="openFilterDatePicker($event, condition, '$fromOpened')"
+                 datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+          />
+          <button class="open" ng-click="openFilterDatePicker($event, condition, '$fromOpened')"></button>
+        </div>
+
+        <em>–</em>
+        <div class="data-input">
+          <input type="text" ng-model="condition.dateTo"
+                 class="form-control select-adder" placeholder="结束时间"
+                 datepicker-popup="yyyy-MM-dd"
+                 is-open="condition.$toOpened"
+                 min-date="condition.dateFrom" current-text="今天" clear-text="清除" close-text="关闭"
+                 ng-click="openFilterDatePicker($event, condition, '$toOpened')"
+                 ng-focus="openFilterDatePicker($event, condition, '$toOpened')"
+                 datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+          />
+          <button class="open" ng-click="openFilterDatePicker($event, condition, '$toOpened')"></button>
+        </div>
+      </div>
+      <div class="sreach-input fr">
+        <input type="search" placeholder="单据编号/客户名称/物料名称" class="form-control" ng-model="keyword" ng-search="onSearch()"/>
+        <a class="seek" href="javascript:void(0)" ng-click="onSearch()">搜索</a>
+      </div>
+    </div>
+  </div>
+  <table class="order-table block" ng-table="tableParams">
+    <thead>
+    <tr class="header">
+      <th>样品</th>
+      <th width="120">样品数量</th>
+      <th width="200">关联单据</th>
+      <th width="140">送样信息</th>
+      <th width="70">操作</th>
+    </tr>
+    </thead>
+    <tbody ng-repeat="approval in $data">
+    <tr class="order-hd">
+      <td class="first" colspan="3">
+        <div class="order-main">
+          <!--<span> <input type="checkbox" class="selector"
+            ng-model="approval.$selected">
+          </span> -->
+          <span class="text-num text-bold" title="{{approval.inDate | date: 'yyyy年MM月dd日 hh:mm'}}">
+            日期:{{::approval.inDate | date:'yyyy-MM-dd'}}
+          </span>
+          <span title="客户名称">
+            <img src="static/img/user/images/shop_home.png">{{::approval.enterprise.enName}}
+          </span>
+          单号:<span
+            title="认定单号" ng-bind="::approval.code"></span>
+        </div>
+      </td>
+      <td colspan="1" class="order-sum"><span
+          ng-if="approval.finalresult" class="label "
+          ng-class="{'label-success': approval.finalresult == '合格', 'label-warning': approval.finalresult != '合格'}">
+						<i class="fa fa-legal"></i> {{::approval.finalresult}}
+				</span></td>
+      <td colspan="1" class="text-center">
+        <div class="operates">
+          <!-- <a href="#" class="text-muted" title="打印">
+          <i class="fa fa-print fa-lg fa-fw"></i>
+        </a> -->
+        </div>
+      </td>
+    </tr>
+    <tr class="order-bd">
+      <td class="product" title="{{approval.prodSpec}}">
+        <div class="text-num text-bold">
+          <span>
+            物料型号:{{approval.prodCode}}
+          </span>
+        </div>
+        <div>
+          <span>
+            物料名称:{{approval.prodDetail}}
+          </span>
+        </div>
+        <div class="text-muted">
+          物料规格:{{approval.prodSpec}}
+        </div>
+      </td>
+      <td class="text-center">
+        <div class="text-num text-bold" title="{{approval.sampleqty}}"
+             >
+         {{approval.sampleqty}}
+        </div>
+        <div class="text-muted" ng-bind="approval.prodUnit"></div>
+      </td>
+      <td class="br-l">
+        <div class="dropdown">
+          申请单: <span ng-bind="::approval.pscode"
+                     class="dropdown-toggle text-success"></span>
+          <!-- <i class="fa fa-fw fa-angle-down"></i>
+        <div class="dropdown-menu pane" style="width: 270px;">
+          <div class="pane-body">
+            申请单
+          </div>
+        </div> -->
+        </div>
+        <div class="row">
+          <div class="col-xs-4">附件:</div>
+          <div class="col-xs-8" ng-if="approval.attachs == 0">无</div>
+          <div class="col-xs-8 file" ng-repeat="attach in approval.attachs"
+               ng-if="approval.attachs.length > 0">
+            <a href="file/{{attach.id}}" ng-bind="::attach.name"></a>
+          </div>
+        </div>
+        <div ng-if="approval.finalresultremark">
+          最终认定:{{::approval.finalresultremark}}</div>
+      </td>
+      <td class="br-l" colspan="2">
+        <div ng-if="approval.material || approval.materialquality">
+          <span ng-if="approval.material">材料:{{::approval.material}}&nbsp;&nbsp;</span>
+          <span ng-if="approval.materialquality">材质:{{::approval.materialquality}}</span>
+        </div>
+        <div ng-if="approval.address || approval.addressmark">
+          <span ng-if="approval.address">产地:{{::approval.address}}&nbsp;&nbsp;</span>
+          <span ng-if="approval.addressmark">产地标示:{{::approval.addressmark}}</span>
+        </div>
+        <div ng-if="approval.height">
+						<span ng-if="approval.height">单重:{{::approval.height}}
+							g&nbsp;&nbsp;</span>
+        </div>
+      </td>
+    </tr>
+    <tr class="order-bd checkItem">
+      <td class="product" colspan="5">
+        <ul class="list-group">
+          <li class="list-group-item text-muted ">
+            <div class="row">
+              <div class="col-md-2">
+                <i class="fa fa-check-square-o fa-fw"></i>&nbsp;研发认定
+              </div>
+              <div class="col-md-10">
+									<span ng-if="approval.prdtime">收到样品时间:{{::approval.prdtime
+										| date: 'yyyy-MM-dd'}}&nbsp;&nbsp;</span> <span
+                  ng-if="approval.prdypsl">收到样品数量:{{::approval.prdypsl}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.prdresult">综合判定:{{::approval.prdresult}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.prdadvice">建议:{{::approval.prdadvice}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.prdremark">描述:{{::approval.prdremark}}&nbsp;&nbsp;</span>
+                附件:<span ng-if="approval.prdAttachs.length == 0">无</span> <span
+                  ng-repeat="attach in approval.prdAttachs"><a
+                  class="file" href="file/{{attach.id}}" ng-bind="::attach.name"></a>&nbsp;&nbsp;</span>
+              </div>
+            </div>
+          </li>
+        </ul>
+        <ul class="list-group" style="margin-top: 10px;">
+          <li class="list-group-item text-muted ">
+            <div class="row">
+              <div class="col-md-2">
+                <i class="fa fa-check-square-o fa-fw"></i>&nbsp;IQC认定
+              </div>
+              <div class="col-md-10">
+									<span ng-if="approval.padtime">收到样品时间:{{::approval.padtime
+										| date: 'yyyy-MM-dd'}}&nbsp;&nbsp;</span> <span
+                  ng-if="approval.padypsl">收到样品数量:{{::approval.padypsl}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.padresult">综合判定:{{::approval.padresult}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.padadvice">建议:{{::approval.padadvice}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.padremark">描述:{{::approval.padremark}}&nbsp;&nbsp;</span>
+                附件:<span ng-if="approval.padAttachs.length == 0">无</span> <span
+                  ng-repeat="attach in approval.padAttachs"><a
+                  class="file" href="file/{{attach.id}}" ng-bind="::attach.name"></a>&nbsp;&nbsp;</span>
+              </div>
+            </div>
+          </li>
+        </ul>
+        <ul class="list-group" style="margin-top: 10px;">
+          <li class="list-group-item text-muted ">
+            <div class="row">
+              <div class="col-md-2">
+                <i class="fa fa-check-square-o fa-fw"></i>&nbsp;工程认定
+              </div>
+              <div class="col-md-10">
+									<span ng-if="approval.ppdtime">收到样品时间:{{::approval.ppdtime
+										| date: 'yyyy-MM-dd'}}&nbsp;&nbsp;</span> <span
+                  ng-if="approval.ppdypsl">收到样品数量:{{::approval.ppdypsl}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.ppdresult">综合判定:{{::approval.ppdresult}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.ppdadvice">建议:{{::approval.ppdadvice}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.ppdremark">描述:{{::approval.ppdremark}}&nbsp;&nbsp;</span>
+                附件:<span ng-if="approval.ppdAttachs.length == 0">无</span> <span
+                  ng-repeat="attach in approval.ppdAttachs"><a
+                  class="file" href="file/{{attach.id}}" ng-bind="::attach.name"></a>&nbsp;&nbsp;</span>
+              </div>
+            </div>
+          </li>
+        </ul>
+      </td>
+    </tr>
+    </tbody>
+    <tbody ng-if="$data.length === 0">
+    <tr>
+      <td colspan="6">
+        <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>
+            <a href="javascript:location.reload()">点击重新加载<i class="load_icon"></i></a>
+          </div>
+        </div>
+      </td>
+    </tr>
+    </tbody>
+  </table>
+  <div ng-if="infoCommon.totalElement > 0" class="text-mns text-right" ng-class="infoCommon.totalElement >= 20 ? '': 'Boom18'">
+    显示&nbsp;{{(infoCommon .page - 1 ) * infoCommon.size + 1}}-{{infoCommon.all >= 20 ? infoCommon.page *  infoCommon.size: (infoCommon.page - 1 ) * infoCommon.size + infoCommon.all}}&nbsp;条,共&nbsp;{{infoCommon.totalElement}}&nbsp;条
+  </div>
+</div>

+ 32 - 7
src/main/webapp/resources/view/vendor/b2b/sale/sale_badOut.html

@@ -290,13 +290,22 @@
 <div class="block user_right fr" id="public" style="    position: relative">
   <div class="pro_management device">
     <div class="com_tab" style="margin-bottom: 10px">
-      <ul class="fl" style="width: 100%">
-        <li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">公司产品库</a></li>
-        <li ng-class="{'active': tab == 'material_person'}"><a ui-sref="vendor_material_person">个人产品库</a></li>
-        <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
-        <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>
-        <li ng-if="isPcbStore"><a ui-sref="vendor_upload">产品导入</a></li>
-        <li ng-class="{'active': tab == 'B2b'}"><a ui-sref="sale_badOut">B2b客户出入库</a></li>
+      <ul class="fl" style="width: 100%" ng-if="!isPcbStore">
+        <li ng-class="{'active': $$productOn.tab == 'bathOn'}"><a>导入产品</a></li>
+        <!--<li ng-class="{'active': $$productOn.tab == 'bathOn'}" ng-click="toggleActive('bathOn')"><a href="">导入产品并上架</a></li>-->
+        <!--<li ng-class="{'active': $$productOn.tab == 'bathOnPerson'}" ng-click="toggleActive('bathOnPerson')"><a href="">导入产品</a></li>-->
+      </ul>
+      <ul class="fl" style="width: 100%" ng-if="isPcbStore">
+        <!--<li><a ui-sref="vendor_material">公司产品库</a></li>-->
+        <!--<li><a ui-sref="vendor_material_person">个人产品库</a></li>-->
+        <!--<li><a ui-sref="vendor_onSale">在售产品</a></li>-->
+        <!--<li><a ui-sref="vendor_storage">出入库</a></li>-->
+        <!--<li><a ui-sref="vendor_undercarriage">上下架历史</a></li>-->
+        <li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">产品库</a></li>
+        <li ng-class="{'active': tab == 'storage'}"><a ui-sref="vendor_storage">出入库</a></li>
+        <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架记录</a></li>
+        <li><a ui-sref="vendor_upload">产品导入</a></li>
+        <li class="active"><a ui-sref="sale_badOut">B2b客户出入库</a></li>
         <li class="down-purchase">
           <span ng-click="exportXls()">
               <i class="fa fa-file-excel-o fa-fw"></i>导出Excel
@@ -306,6 +315,22 @@
           </form>
         </li>
       </ul>
+      <!--<ul class="fl" style="width: 100%">-->
+        <!--<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">公司产品库</a></li>-->
+        <!--<li ng-class="{'active': tab == 'material_person'}"><a ui-sref="vendor_material_person">个人产品库</a></li>-->
+        <!--<li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>-->
+        <!--<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>-->
+        <!--<li ng-if="isPcbStore"><a ui-sref="vendor_upload">产品导入</a></li>-->
+        <!--<li ng-class="{'active': tab == 'B2b'}"><a ui-sref="sale_badOut">B2b客户出入库</a></li>-->
+        <!--<li class="down-purchase">-->
+          <!--<span ng-click="exportXls()">-->
+              <!--<i class="fa fa-file-excel-o fa-fw"></i>导出Excel-->
+          <!--</span>-->
+          <!--<form style="display: none;" id="down-load-purchase" method="get" class="ng-pristine ng-valid">-->
+            <!--<input type="hidden" name="ids" ng-value="localInfo.ids">-->
+          <!--</form>-->
+        <!--</li>-->
+      <!--</ul>-->
     </div>
   </div>
   <div class="tab_top" style="margin-bottom: 10px">

+ 575 - 0
src/main/webapp/resources/view/vendor/b2b/sale/sample.html

@@ -0,0 +1,575 @@
+<style>
+  .order-table .header>th {
+    height: 38px;
+    text-align: center;
+    /*background: #f5f5f5;*/
+    border-top: 1px solid #e8e8e8;
+    border-bottom: 1px solid #e8e8e8;
+  }
+
+  .order-table .sep-row {
+    height: 10px;
+  }
+
+  .order-table .selector {
+    vertical-align: middle;
+    margin: 0 0 2px 0;
+  }
+
+  .toolbar label {
+    margin-right: 10px;
+    margin-bottom: 0;
+  }
+
+  .toolbar .select_all {
+    margin: 0 6px 0 10px;
+    line-height: 20px;
+  }
+
+  .toolbar .btn {
+    -moz-border-radius: 2px;
+    margin-right: 5px;
+    border: 1px solid #dcdcdc;
+    border-radius: 2px;
+    -webkit-border-radius: 2px;
+  }
+
+  .order-table .order-hd {
+    background: #f5f5f5;
+    height: 40px;
+    line-height: 40px;
+  }
+
+  .order-table .order-hd td.first {
+    padding-left: 20px;
+  }
+
+  .order-table .order-hd .order-main span {
+    margin-right: 8px;
+  }
+
+  .order-table .order-hd .order-code {
+    font-style: normal;
+    font-family: verdana;
+  }
+
+  .order-table .order-hd .order-sum {
+    padding: 0 5px;
+  }
+
+  .order-table>tbody {
+    border: 1px solid transparent;
+  }
+
+  .order-table>tbody:hover {
+    border-color: #56a022;
+    border-width: 2px;
+  }
+
+  .order-table .operates {
+    display: none;
+  }
+
+  .order-table>tbody:hover .operates {
+    display: block;
+  }
+
+  .order-table>tbody:hover .operates-status {
+    display: none;
+  }
+
+  .order-table .order-bd {
+    border-bottom: 1px solid #e6e6e6;
+  }
+
+  .order-table .order-bd>td {
+    padding: 10px 5px;
+    vertical-align: top;
+    position: relative;
+  }
+
+  .order-table .order-bd .product {
+    padding-left: 20px;
+  }
+
+  .input-xs,.input-group-xs>.form-control,.input-group-xs>.input-group-addon,.input-group-xs>.input-group-btn>.btn
+  {
+    height: 26px;
+    padding: 0 5px;
+    font-size: 12px;
+    line-height: 1.5;
+    border-radius: 3px;
+  }
+
+  .input-group-xs .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn {
+    border-top-left-radius: 0;
+    border-bottom-left-radius: 0;
+  }
+
+  .modal-dialog {
+    margin-top: 110px;
+  }
+
+  .sampleSend .col {
+    padding-left: 5px;
+    padding-right: 5px;
+    line-height: 30px;
+  }
+
+  .sampleSend label {
+    font-weight: bold;
+    text-align: right;
+    font-family: "Microsoft YaHei","微软雅黑";
+    line-height: 30px;
+  }
+
+  .menu .new-dot{
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    font-size: 12px;
+    color: #fff;
+    font-weight: inherit;
+    top: -2px;
+  }
+</style>
+<style>
+  .order-table {
+    background: #fff;
+    width: 100%;
+    /*margin-bottom: 10px;*/
+  }
+  .order-table thead tr {
+    background: #fff;
+  }
+  .order-table .header>th {
+    height: 38px;
+    text-align: center;
+    /*background: #f5f5f5;*/
+    border-top: 1px solid #e8e8e8;
+    /*border-bottom: 1px solid #e8e8e8;*/
+    font-size: 14px;
+  }
+
+  /*.order-table .sep-row {*/
+  /*height: 10px;*/
+  /*}*/
+
+  .order-table .selector {
+    vertical-align: middle;
+    margin: 0 0 2px 0;
+  }
+
+  .toolbar label {
+    margin-right: 10px;
+    margin-bottom: 0;
+  }
+
+  .toolbar .select_all {
+    margin: 0 6px 0 10px;
+    line-height: 20px;
+  }
+
+  .toolbar .btn {
+    -moz-border-radius: 2px;
+    margin-right: 5px;
+    border: 1px solid #dcdcdc;
+    border-radius: 2px;
+    -webkit-border-radius: 2px;
+  }
+
+  .order-table .order-hd {
+    /*background: #f5f5f5;*/
+    background: #f9f9f9;
+    height: 40px;
+    line-height: 40px;
+  }
+
+  .order-table .order-hd td.first {
+    padding-left: 20px;
+  }
+
+  .order-table .order-hd .order-main span {
+    margin-right: 8px;
+  }
+
+  .order-table .order-hd .order-code {
+    font-style: normal;
+    font-family: verdana;
+  }
+
+  .order-table .order-hd .order-sum {
+    padding: 0 5px;
+  }
+
+  .order-table .order-info {
+    padding-left: 20px;
+  }
+
+  .order-table>tbody {
+    border: 1px solid #e8e8e8;
+  }
+
+  .order-table>tbody:hover {
+    border-color: #3f84f6;
+    border-width: 2px;
+  }
+
+  .order-table>tbody:hover tr.order-bd {
+    background:#f8fafe
+  }
+  .order-table .operates {
+    display: none;
+  }
+
+  .order-table>tbody:hover .operates {
+    display: block;
+  }
+
+  .order-table .order-bd {
+    border-top: 1px solid #e8e8e8;
+    /*border-bottom: 1px solid #e6e6e6;*/
+  }
+
+  .order-table .order-bd>td {
+    /*height: 140px;*/
+    vertical-align: middle;
+    position: relative;
+    padding: 25px 0;
+    border-right: 1px solid #e8e8e8;
+  }
+  .order-table .order-bd>td:nth-last-of-type(1) {
+    border-right: 0px
+  }
+
+  .order-table .order-bd .product {
+    padding-left: 31px;
+  }
+
+  .menu .new-dot{
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    font-size: 12px;
+    color: #fff;
+    font-weight: inherit;
+    top: -2px;
+  }
+  .screen .radio-block.date-radio {
+    width: auto
+  }
+  .order-table span,.order-table div {
+    font-size: 14px;
+    color: #333;
+  }
+  .clearfix::after {
+    clear:both;
+    zoom: 1;
+    content: ' ';
+    display: block;
+    visibility: hidden;
+  }
+  .order-table .order-bd .order-number {
+    position: absolute;
+    top: -1px;
+    left: -1px;
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    text-align: center;
+    background: #f9f9f9;
+    font-weight: 500;
+    border: solid 1px #d5d5d5;
+    border-radius: 0 0 10px 0;
+  }
+  .text-trans {
+    top: 22px;
+    right: 6px;
+  }
+  .oder{
+    /*background: #fff;*/
+    /*padding-bottom: 60px;*/
+    position: relative;
+  }
+  .ng-table-pager::after {
+    clear: both;
+    content: ' ';
+    zoom: 1;
+    display: block;
+    visibility: hidden;
+  }
+  .ng-table-pager {
+    padding-right: 20px;
+    padding-top: 50px;
+    margin-right: 0 !important;
+  }
+  .text-mns {
+    padding-right: 15px;
+    position: absolute;
+    bottom: 64px;
+    right: 20px;
+  }
+  .order-table>tbody:hover .operates-status {
+    display: none;
+  }
+  .Boom18 {
+    bottom: 18px
+  }
+</style>
+<div class="user_right fr" style="position: relative">
+
+  <div class="tab_top" style="margin-bottom: 10px">
+    <ul class="fl" style="width: 100%">
+      <li ng-class="{'active': storeType=='sample'}"><a>客户打样申请</a></li>
+      <li ng-class="{'active': storeType=='approval'}"><a ui-sref="sale_approval">客户认定单</a></li>
+      <li class="down-purchase" style="float:right;color: #5078cb;margin-right: 5px;"><span ng-click="exportXls()"><i class="fa fa-file-excel-o fa-fw"></i>导出Excel</span></li>
+    </ul>
+  </div>
+  <div class="oder01" style="margin-bottom: 0px">
+    <ul>
+      <li ng-class="{'active': active=='all'}" ng-click="setActive('all')"><a> 全部(<em ng-class="{'color-black': !unread.all }" ng-bind="unread.all || 0"></em>)</a></li>
+      <li ng-class="{'active': active=='done'}" ng-click="setActive('done');"><a>已送样(<em ng-class="{'color-black': !unread.notReply }" ng-bind="unread.notReply || 0"></em>)</a></li>
+      <li ng-class="{'active': active=='todo'}" ng-click="setActive('todo')"><a>待送样(<em ng-class="{'color-black': !unread.replied }" ng-bind="unread.replied || 0"></em>)</a></li>
+      <li ng-class="{'active': active=='invalid'}" ng-click="setActive('invalid')"><a>已作废</a></li>
+    </ul>
+  </div>
+  <div class="screen check-filter">
+    <div class="radio-block date-radio">
+      时间筛选:
+      <label class="com-check-radio">
+        <input type="radio" id="oneMonth" name="date" ng-click="autoMonth = false;changeDateZone(1);condition.$open=false" checked>
+        <label for="oneMonth"></label>
+        30天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="threeMonth" name="date" ng-click="autoMonth = false;changeDateZone(3);condition.$open=false">
+        <label for="threeMonth"></label>
+        90天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="sixMonth" name="date" ng-click="autoMonth = false;changeDateZone(6);condition.$open=false">
+        <label for="sixMonth"></label>
+        180天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="autoMonth" name="date" ng-click="autoMonth = true;condition.$open=!condition.$open;changeDateZone(-1)">
+        <label for="autoMonth"></label>
+        自定义
+      </label>
+    </div>
+    <div class="sreach fr">
+      <div ng-show="autoMonth" class="date fl">
+        <div class="data-input">
+          <input type="text" ng-model="condition.dateFrom"
+                 class="form-control select-adder" placeholder="起始时间"
+                 datepicker-popup="yyyy-MM-dd"
+                 is-open="condition.$fromOpened"
+                 max-date="condition.dateTo" current-text="今天" clear-text="清除" close-text="关闭"
+                 ng-click="openFilterDatePicker($event, condition, '$fromOpened')"
+                 ng-focus="openFilterDatePicker($event, condition, '$fromOpened')"
+                 datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+          />
+          <button class="open" ng-click="openFilterDatePicker($event, condition, '$fromOpened')"></button>
+        </div>
+
+        <em>–</em>
+        <div class="data-input">
+          <input type="text" ng-model="condition.dateTo"
+                 class="form-control select-adder" placeholder="结束时间"
+                 datepicker-popup="yyyy-MM-dd"
+                 is-open="condition.$toOpened"
+                 min-date="condition.dateFrom" current-text="今天" clear-text="清除" close-text="关闭"
+                 ng-click="openFilterDatePicker($event, condition, '$toOpened')"
+                 ng-focus="openFilterDatePicker($event, condition, '$toOpened')"
+                 datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+          />
+          <button class="open" ng-click="openFilterDatePicker($event, condition, '$toOpened')"></button>
+        </div>
+      </div>
+      <div class="sreach-input fr">
+        <input type="search" placeholder="单据编号/客户名称/物料名称" class="form-control" ng-model="keyword" ng-search="onSearch()"/>
+        <a class="seek" href="javascript:void(0)" ng-click="onSearch()">搜索</a>
+      </div>
+    </div>
+  </div>
+  <table class="order-table block" ng-table="tableParams">
+    <thead>
+    <tr class="header">
+      <th>样品</th>
+      <th width="120">数量</th>
+      <th width="60">是否收费</th>
+      <th width="140">单价</th>
+      <th width="120">需求日期</th>
+      <th width="100">操作</th>
+    </tr>
+    <!--<tr class="sep-row">-->
+      <!--<td colspan="5"></td>-->
+    <!--</tr>-->
+    </thead>
+    <tbody ng-repeat="sample in $data">
+    <tr class="order-hd">
+      <td class="first" colspan="3">
+        <div class="order-main">
+          <a href="javascript:void(0)" ng-if="!isUnread(sample.id)" class="circle-icon">
+           已读
+          </a>
+          <a href="javascript:void(0)" ng-if="isUnread(sample.id)" class="no-circle-icon">
+           未读
+          </a>&nbsp;&nbsp;
+          <!--<span> <input type="checkbox" class="selector"
+            ng-model="sample.$selected">
+          </span> --><span class="text-num text-bold" title="{{sample.proofing.date | date: 'yyyy年MM月dd日 hh:mm'}}">
+          日期:{{sample.proofing.date | date:'yyyy-MM-dd'}}
+        </span>
+          <span title="客户名称"><img src="static/img/user/images/shop_home.png">{{sample.proofing.enterprise.enName}}</span>
+          <span>流水号:<a class="text-num order-detail" ng-bind="::sample.proofing.code" title="查看详情"
+                       ui-sref="sale_sample_detail({id:sample.id})" target="_self" style="color:#5078cb"
+                       ng-click="setOrdersRead(sample.id)"></a>
+					</span>
+        </div>
+      </td>
+      <td class="text-center"  colspan="2" >
+        <div ng-show="sample.proofing.isCharge == '是' && !isUser">
+          总额:<span class="text-num" ng-bind="sample.amount | currency: currency(sample.currency)" style="font-weight: bold;"></span>RMB
+        </div>
+      </td>
+      <td colspan="1" class="text-center">
+        <span ng-if="sample.print && sample.status != 315" class="label ng-scope operates-status" style="color: #3c7cf5;background: #fff;margin-right: 5px;border:1px solid #3c7cf5">已打印</span>
+        <span ng-if="!sample.print && sample.status != 315" class="label ng-scope operates-status" style="color: #fff;background: #3c7cf5;margin-right: 5px;border: 1px solid #3c7cf5;">未打印</span>
+        <div class="operates">
+          <a href="#" ng-if="sample.status != 315" ng-click="print(sample)" class="text-muted" title="打印">
+            <i class="fa fa-print fa-lg fa-fw"></i>打印
+          </a>
+        </div>
+      </td>
+    </tr>
+    <tr class="order-bd">
+      <td class="product">
+        <div class="text-num text-bold">
+          <span>
+            物料编码:{{sample.proofing.product.code}}
+          </span>
+        </div>
+        <div>
+          <span>
+            物料名称:{{sample.proofing.product.title}}
+          </span>
+        </div>
+        <div class="text-muted" title="{{sample.proofing.product.spec}}">
+          物料规格:{{sample.proofing.product.spec}}
+        </div>
+        <div ng-if="sample.proofing.envrequiry" title="环保要求">
+          <i class="fa fa-tree fa-fw" style="color: #33CC33; font-size: 18px;"></i> 环保要求:<span ng-bind="::sample.proofing.envrequiry"></span>
+        </div>
+        <div ng-if="sample.proofing.attachs.length > 0">
+          <div ng-repeat="attach in sample.proofing.attachs">
+            <i class="fa fa-paperclip fa-fw" style="color: #ffa340; font-size: 18px;"></i>附件:<a class="file" href="file/{{attach.id}}" ng-bind="::attach.name"></a>
+          </div>
+        </div>
+      </td>
+      <td class="text-center">
+        <div class="text-num text-bold"
+             title="{{sample.qty}}" ng-bind="sample.qty"></div>
+        <div class="text-muted" ng-bind="sample.proofing.product.unit"></div>
+      </td>
+      <td class="text-center">
+        <div ng-show="sample.proofing.isCharge == '是'">是</div>
+        <div ng-show="sample.proofing.isCharge != '是'">否</div>
+      </td>
+      <td class="text-center">
+        <div ng-show="sample.proofing.isCharge == '是' && !isUser" class="text-num">
+          <span ng-bind="sample.currency"></span>
+          <span ng-bind="::sample.price | number:6"></span>
+        </div>
+        <div ng-show="sample.proofing.isCharge == '是'" class="text-muted">
+          税率:<span class="text-num" ng-bind="::sample.taxrate"></span>%
+        </div>
+      </td>
+      <td class="text-center br-l">
+        <div class="text-num" title="交货日期"
+             ng-bind="sample.proofing.delivery | date: 'yyyy-MM-dd'"></div><br>
+        <div ng-if="sample.status == 400" class="dropdown text-center">
+          <a href="javascript:void(0);"
+             class="dropdown-toggle text-default"
+             ng-mouseover="getSend(sample)">送样信息<i
+              class="fa fa-fw fa-angle-down"></i></a>
+          <div class="dropdown-menu pane" style="width: 270px;">
+            <div class="pane-body">
+              <span ng-if="sample.getSendInfo" ng-bind="sample.getSendInfo"></span>
+              <ul ng-if="sample.sends" ng-repeat="send in sample.sends | orderBy : '-date'" class="list-unstyled list-menu">
+                <li>
+                  <div class="row row-sm">
+                    <div class="col-xs-7 text-inverse" ng-bind="send.date | date: 'yyyy-MM-dd HH:mm'"></div>
+                    <div class="col-xs-5" ng-bind="send.recorder"></div>
+                  </div>
+                  <div>
+                    送样单号:<span class="text-inverse" ng-bind="send.code"></span>
+                  </div>
+                  <div>
+                    送样数量:<span class="text-num text-inverse" ng-bind="send.sendQty"></span>
+                  </div>
+                  <div ng-if="send.puprice && !isUser">
+                    采购单价:<span class="text-num text-inverse" ng-bind="send.puprice | number:6"></span>
+                  </div>
+                  <div class="row row-sm">
+                    <div class="col-xs-6" ng-if="send.minQty">最小包装量:<span ng-bind="send.minQty"></span></div>
+                    <div class="col-xs-6" ng-if="send.minBuyQty">最小订购量:<span ng-bind="send.minBuyQty"></span></div>
+                  </div>
+                  <div class="row row-sm" ng-if="send.attachs.length > 0">
+                    <div class="col-xs-3">附件:</div>
+                    <div class="col-xs-9">
+                      <div ng-repeat="attach in send.attachs"><a href="file/{{attach.id}}" class="file">{{attach.name}}</a></div>
+                    </div>
+                  </div>
+                </li>
+              </ul>
+            </div>
+          </div>
+        </div>
+
+      </td>
+      <td class="br-l text-center">
+        <div ng-show="sample.status == 401">
+          <a ng-click="openSend($index, sample)" class="text-muted" title="送样">
+            <i class="fa fa-paper-plane fa-lg fa-fw"></i><br>
+            送样
+          </a>
+        </div>
+        <div ng-if="sample.status == 400 && !(sample.qty > (sample.sendQty || 0))" class="block">
+          <span class="text-trans success">已送样</span>
+        </div>
+        <div ng-if="sample.status == 400 && sample.qty > (sample.sendQty || 0)" class="block">
+          <span class="text-trans half">部分送样</span>
+        </div>
+        <div ng-if="sample.status == 400 && sample.qty > (sample.sendQty || 0)" style="margin-top: 40px;">
+          <a ng-click="openSend($index, sample)" class="text-muted" title="送样">
+            送样
+          </a>
+        </div>
+        <div ng-if="sample.status == 315" class="block">
+          <span class="text-trans text-light">已作废</span>
+        </div>
+      </td>
+    </tr>
+    </tbody>
+    <tbody ng-if="$data.length === 0">
+    <tr>
+      <td colspan="6">
+        <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>
+            <a href="javascript:location.reload()">点击重新加载<i class="load_icon"></i></a>
+          </div>
+        </div>
+      </td>
+    </tr>
+    </tbody>
+  </table>
+  <div ng-if="infoCommon.totalElement > 0" class="text-mns text-right" ng-class="infoCommon.totalElement >= 20 ? '': 'Boom18'">
+    显示&nbsp;{{(infoCommon .page - 1 ) * infoCommon.size + 1}}-{{infoCommon.all >= 20 ? infoCommon.page *  infoCommon.size: (infoCommon.page - 1 ) * infoCommon.size + infoCommon.all}}&nbsp;条,共&nbsp;{{infoCommon.totalElement}}&nbsp;条
+  </div>
+</div>

+ 366 - 0
src/main/webapp/resources/view/vendor/b2b/sale/sample_detail.html

@@ -0,0 +1,366 @@
+<style>
+  .text-trans {
+    top: -25px;
+    right: 50px;
+    font-size: 35px;
+    font-family: Microsoft Yahei Regular;
+  }
+  .text-trans{
+    font-size: 14px;
+  }
+</style>
+<style>
+  .text-trans {
+    right: 24px
+  }
+  .base-info {
+    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -o-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    /*min-height: 1066px;*/
+    background: #fff;
+    width: 1026px;
+  }
+  #order-detail-list {
+    font-size: 14px;
+  }
+  .pub-com_head, .com_head {
+    width: 100%;
+    height: 35px;
+    line-height: 35px;
+    background: #5078cb;
+    border-radius: 5px 5px 0 0;
+    /* background: url(../img/approvalFlow/comm_bg01.png) no-repeat left; */
+    /* background-color: #f5f5f5; */
+    /* background-size: 100% 100%; */
+  }
+  .pub-com_head span, .com_head span {
+    margin-left: 10px;
+    color: #fff;
+    font-size: 14px;
+    font-weight: bold;
+  }
+  .pub-com_head .p-right {
+    float: right;
+  }
+  .pane .pane-body {
+    /*padding: 15px!important;*/
+  }
+  com_title01, .title-div {
+    /*border-bottom: 1px dashed #3f84f6 !important;*/
+  }
+  .title-div {
+    color: #5078cb;
+    font-size: 14px;
+    font-weight: 600;
+    /*padding-left: 20px !important;*/
+    height: 50px;
+    padding-top: 11px;
+    position: relative;
+  }
+  .f14 {
+    font-size: 14px !important;
+  }
+  #order-detail-list .row {
+    width: 96%;
+    margin: 0 auto;
+    line-height: 30px;
+  }
+  .base-info .item {
+    line-height: 26px;
+    /* border-bottom: 1px dotted #e8e8e8; */
+    padding: 5px 0;
+  }
+  #order-detail-list .title {
+    font-weight: inherit;
+  }
+  .base-info .title {
+    float: left;
+    width: 92px;
+    color: #333;
+    font-weight: bold;
+  }
+  #order-detail-list .content {
+    color: #666;
+  }
+  .base-info .content {
+    float: left;
+    white-space: nowrap;
+  }
+  .title-div .end {
+    position: absolute;
+    top: 10px;
+    right: 0;
+    line-height: 24px;
+    padding-left: 15px;
+    background: #fff;
+    z-index: 2;
+  }
+  .block {
+    background-color: #fff;
+    border-radius: 5px;
+    width: 100%;
+    position: relative;
+    margin-bottom: 0px;
+  }
+  #order-detail-list .table-default .header {
+    box-shadow: none;
+    border: none;
+    background: none;
+    background: #f9f9f9;
+  }
+  #order-detail-list .table-default .header th {
+    /*display: inline-block;*/
+    border-bottom: none;
+    font-weight: normal;
+    color: #999;
+  }
+  #order-detail-list .table-default th, #order-detail-list .table-default td {
+    /*border-top: #ddd 1px dotted;*/
+  }
+  #order-detail-list .table-default tbody tr {
+    background: none;
+    position: relative;
+  }
+  #order-detail-list .table-default tbody tr td {
+    vertical-align: middle;
+    color: #323232;
+    position: relative;
+    padding: 25px 0px;
+  }
+  [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {
+    display: none !important;
+  }
+  .text-bold {
+    font-weight: 700;
+  }
+
+  .text-num {
+    font-style: normal;
+    word-break: break-all;
+    font-size: 14px;
+  }
+  .text-muted {
+    color: #333;
+    font-size: 14px;
+  }
+  .bottomB {
+    border-bottom: 2px solid #f5f5f5;
+    padding: 15px 30px 15px 15px;
+  }
+
+  .title-div .f14{
+    border-left: 5px solid #5078cb;padding-left: 10px;
+  }
+
+  .order-number {
+    position: absolute;
+    top: -1px;
+    left: -1px;
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    text-align: center;
+    background: #f9f9f9;
+    font-weight: 500;
+    border: solid 1px #d5d5d5;
+    border-radius: 0 0 10px 0;
+  }
+  #order-detail-list .table-default tbody tr td.product {
+    padding-left: 30px;
+  }
+  #order-detail-list .table-default tbody tr td{
+    border-right: 1px solid #e8e8e8;
+  }
+  .text-trans {
+    top: -20px;
+  }
+  table thead tr th {
+    text-align: center;
+  }
+</style>
+<div class="pane base-info fr"   id="order-detail-list">
+  <div class="pub-com_head">
+    <span>客户打样申请单</span>
+    <div class="p-right">
+    </div>
+  </div>
+  <div class="pane-body">
+    <div class="bottomB">
+    <div class="title-div">
+      <span class="f14">单据信息</span>&nbsp;
+      <div ng-if="sample.status == 401" class="block">
+        <span class="text-trans todo">待送样</span>
+      </div>
+      <div ng-if="sample.status == 400 && !(sample.qty > (sample.sendQty || 0))" class="block">
+        <span class="text-trans success">已送样</span>
+      </div>
+      <div ng-if="sample.status == 400 && sample.qty > (sample.sendQty || 0)" class="block">
+        <span class="text-trans success">部分送样</span>
+      </div>
+      <div ng-if="sample.status == 315" class="block">
+        <span class="text-trans text-light">已作废</span>
+      </div>
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">单据编号</span>
+        <div class="content" ng-bind="::sample.proofing.code"></div>
+      </div>
+      <div class="col-xs-3">
+        <span class="title">日期</span>
+        <div class="content" ng-bind="::sample.proofing.date | date:'yyyy-MM-dd'"></div>
+      </div>
+      <div class="col-xs-6">
+        <span class="title">客户</span>
+        <div class="content" ng-bind="::sample.proofing.enterprise.enName"></div>
+      </div>
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">需求数</span>
+        <div class="content" title="{{sample.qty}}" ng-bind="::sample.qty"></div>
+      </div>
+      <div class="col-xs-3">
+        <span class="title" ng-hide="sample.proofing.isCharge != '是'">单价</span>
+        <span class="title" ng-show="sample.proofing.isCharge != '是'">是否收费</span>
+        <div ng-show="sample.proofing.isCharge != '是'">否</div>
+        <div ng-show="sample.proofing.isCharge == '是' && !isUser" class="text-num">
+          <span ng-bind="sample.currency"></span> <span
+            ng-bind="sample.price | number:6"></span>
+        </div>
+      </div>
+      <div ng-show="sample.proofing.isCharge == '是'" class="col-xs-3">
+        <span class="title">税率</span>
+        <span class="content" ng-bind="sample.taxrate || 0"></span>%
+      </div>
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">交货日期</span>
+        <div class="content"
+             ng-bind="::sample.proofing.delivery | date: 'yyyy-MM-dd'"></div>
+      </div>
+      <div class="col-xs-3">
+        <span class="title">送样申请人</span>
+        <div class="content" ng-bind="::sample.proofing.user.userName"></div>
+      </div>
+      <div class="col-xs-6">
+        <span class="title">备注</span>
+        <div class="content" ng-bind="::sample.proofing.remark"></div>
+        <div class="content" ng-show="!sample.proofing.remark">无</div>
+      </div>
+    </div>
+    </div>
+    <div class="bottomB">
+    <div class="title-div">
+      <span class="f14">物料信息</span>&nbsp;
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">物料名称</span>
+        <div class="content">
+          <span ng-bind="::sample.proofing.product.title"></span>
+        </div>
+      </div>
+      <div class="col-xs-4">
+        <span class="title">物料型号</span>
+        <div class="content">
+          <span ng-bind="::sample.proofing.product.code"></span>
+        </div>
+      </div>
+      <div class="col-xs-12">
+        <span class="title">物料规格</span>
+        <div class="text-num content">
+          <span ng-bind="::sample.proofing.product.spec"></span>
+        </div>
+      </div>
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">环保要求</span>
+        <div class="content" ng-bind="::sample.proofing.envrequiry"></div>
+        <div class="content" ng-show="!sample.proofing.envrequiry">无</div>
+      </div>
+    </div>
+    </div>
+    <div class="block" ng-show="sample.status != 401">
+      <table class="block table table-default table-striped table-hover">
+        <thead>
+        <tr class="header">
+          <th width="120">单号</th>
+          <th width="100">送样时间</th>
+          <th width="70">采购单价</th>
+          <th width="70">送样数量</th>
+          <th width="60">交货周期</th>
+          <th width="90">送样人</th>
+          <th width="140">其他信息</th>
+        </tr>
+        </thead>
+        <tbody>
+        <tr ng-repeat="send in sample.sends | orderBy : '-date'">
+          <td class="text-center">
+            <span class="text-num">{{send.code}}</span>
+          </td>
+          <td class="text-center">
+            <span class="text-num">{{send.date | date: 'yyyy-MM-dd HH:mm'}}</span>
+          </td>
+          <td class="text-center" ng-if="!isUser">
+            <div>
+              <span class="text-num">{{send.puprice}}</span>
+            </div>
+            <div ng-if="send.currency">
+              <span class="text-num">{{send.currency}}</span>
+            </div>
+          </td>
+          <td class="text-center" ng-if="isUser" ></td>
+          <td class="text-center">
+            <span class="text-num">{{send.sendQty}}</span>
+          </td>
+          <td class="text-center">
+            <span class="text-num">{{send.delivery}}</span>
+          </td>
+          <td class="text-center">
+            <span class="text-num">{{send.recorder}}</span>
+          </td>
+          <td>
+            <div ng-if="send.minQty">最小包装量:<span ng-bind="send.minQty"></span></div>
+            <div ng-if="send.minBuyQty">最小订购量:<span ng-bind="send.minBuyQty"></span></div>
+            <div ng-if="send.vendSpec">生产厂型号:<span ng-bind="send.vendSpec"></span></div>
+            <div ng-if="send.brand">品牌:<span ng-bind="send.brand"></span></div>
+            <div ng-if="send.weight">单重:<span ng-bind="send.weight"></span></div>
+            <div ng-if="send.material">材料:<span ng-bind="send.material"></span></div>
+            <div ng-if="send.materialQuality">材质:<span ng-bind="send.materialQuality"></span></div>
+            <div ng-if="send.adress">产地:<span ng-bind="send.minBuyQty"></span></div>
+            <div ng-if="send.addressMark">产地标识:<span ng-bind="send.addressMark"></span></div>
+            <div ng-if="send.ratio">口水料比例:<span ng-bind="send.ratio"></span>%</div>
+            <div ng-if="send.attachs.length > 0">
+              附件:<span ng-repeat="attach in send.attachs"><a href="file/{{attach.id}}" class="file">{{attach.name}}</a></span>
+            </div>
+            <!--<div class="row row-sm" ng-if="send.attachs.length > 0">
+              <div class="col-xs-4">附件:</div>
+              <div class="col-xs-8">
+                <div ng-repeat="attach in send.attachs"><a href="file/{{attach.id}}" class="file">{{attach.name}}</a></div>
+              </div>
+            </div>-->
+          </td>
+        </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="text-center" style="padding: 25px 0" ng-show="sample.status == 401">
+      <a ng-click="openSend($index, sample)" class="text-muted" title="送样">
+        <i class="fa fa-paper-plane fa-lg fa-fw"></i><br>
+        还未送样,点击立即送样
+      </a>
+    </div>
+    <div class="text-center" style="padding: 25px 0"  ng-show="sample.status == 400 && sample.qty > (sample.sendQty || 0)">
+      <a ng-click="openSend($index, sample)" class="text-muted" title="送样">
+        <i class="fa fa-paper-plane fa-lg fa-fw"></i><br>
+        未满足需求数,点击立即送样
+      </a>
+    </div>
+  </div>
+</div>

+ 1 - 1
src/main/webapp/resources/view/vendor/b2b/sale_change.html

@@ -507,7 +507,7 @@
 						<span ng-bind="change.description"></span>
 					</td>
 					<td class="text-center br-l" style="vertical-align:middle;padding-top: 0px" rowspan="{{::change.orderChangeItems.length}}" ng-if="$index === 0">
-						<div ng-if="change.status != 200">
+						<div >
 							<div ng-bind="::item.description"></div>
 							<div ng-if="change.agreed == 1 && !change.unNeedReply" class="block">
 								<span class="text-trans success">已同意</span>

+ 1 - 1
src/main/webapp/resources/view/vendor/b2b/sale_inquiry.html

@@ -639,7 +639,7 @@
 			<li ng-class="{'active': active=='todo'}" ng-click="setActive('todo')"><a>待报价(<em ng-class="{'color-black': !unread.notReply }" ng-bind="unread.notReply || 0"></em>)</a></li>
 			<li ng-class="{'active': active=='agreed'}" ng-click="setActive('agreed')"><a>已采纳</a></li>
 			<li ng-class="{'active': active=='refused'}" ng-click="setActive('refused')"><a>未采纳</a></li>
-			<li ng-class="{'active': active=='refused'}" ng-click="setActive('refused')"><a>已失效</a></li>
+			<li ng-class="{'active': active=='invalid'}" ng-click="setActive('invalid')"><a>已失效</a></li>
 		</ul>
 	</div>
 	<div class="condition block">

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

@@ -758,12 +758,12 @@
 					</div>
 				</div>
 				<div ng-if="inquiryMould.attachs.length" class="text-muted">
-					附件:<a class="file" ng-repeat="attach in inquiryMould.attachs" href="file/{{attach.id}}">{{::attach.name}}</a>
+					附件:<a class="file" ng-repeat="attach in inquiryMould.attachs" ng-click="downFile(attach.id)">{{::attach.name}}</a>
 				</div>
 				<div ng-if="inquiryMould.sellAttachs.length" class="text-muted">
 					供应商附件:
 					<div ng-repeat="attach in inquiryMould.sellAttachs track by $index">
-						<a class="file"  href="file/{{attach.id}}">{{::attach.name}}</a>
+						<a class="file"  href="file/{{attach.id}}" >{{::attach.name}}</a>
 						<a style="color: #ff2222" ng-click="removeFile(inquiryMould, attach)">删除</a>
 					</div>
 				</div>

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

@@ -1156,6 +1156,7 @@
                 <li ng-class="{'active': tab == 'storage'}"><a ui-sref="vendor_storage">出入库</a></li>
                 <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架记录</a></li>
                 <li ng-if="isPcbStore"><a ui-sref="vendor_upload">产品导入</a></li>
+                <li ng-class="{'active': tab == 'B2b'}"><a ui-sref="sale_badOut">B2b客户出入库</a></li>
             </ul>
         </div>
         <div class="com_tab com_tab2" style="margin-bottom: 10px">

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

@@ -610,6 +610,7 @@
                 <li ng-class="{'active': tab == 'storage'}"><a ui-sref="vendor_storage">出入库</a></li>
                 <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架记录</a></li>
                 <li ng-if="isPcbStore"><a ui-sref="vendor_upload">产品导入</a></li>
+                <li ng-class="{'active': tab == 'B2b'}"><a ui-sref="sale_badOut">B2b客户出入库</a></li>
             </ul>
         </div>
         <div class="search-check">

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

@@ -545,6 +545,7 @@
                 <li ng-class="{'active': tab == 'storage'}"><a ui-sref="vendor_storage">出入库</a></li>
                 <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架记录</a></li>
                 <li class="active"><a ui-sref="vendor_upload">产品导入</a></li>
+                <li ng-class="{'active': tab == 'B2b'}"><a ui-sref="sale_badOut">B2b客户出入库</a></li>
             </ul>
         </div>
         <div class="remind-line" ng-show="$$productOn.tab == 'bathOn' && showTip"><span class="fl">导入企业库的产品同时会进行上架销售并展示在店铺</span><a ng-click="closeTip()" class="fr">&times;</a></div>

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

@@ -68,7 +68,7 @@
 			<li ng-class="{'active' : active == 'vendor_material'}"><span  ui-sref="vendor_material" ng-bind="isPcbStore ? 'PCB库存管理' : '库存管理'">库存管理</span></li>
 			<!--	<li ng-class="{'active' : active == 'vendor_productOn'}"><span  ui-sref="vendor_productOn">产品导入</span></li>-->
 			<li ng-class="{'active' : active == 'vendor_productOn'}" ng-if="!isPcbStore"><span  ui-sref="vendor_upload">产品导入</span></li>
-
+			<li ng-class="{'active' : active == 'vendor_sample'}"><span  ui-sref="sale_sample">样品管理</span></li>
 	<!--	<li ng-class="{'active' : active == 'vendor_logistics'}"><span  ui-sref="vendor_logistics">物流管理</span></li>-->
 		<!--<li ng-class="{'active' : active == 'vendor_brand_apply'}" ng-if="!isPcbStore"><span  ui-sref="vendor_brand_apply">品牌申请</span></li>-->
 		<!--<li ng-class="{'active' : active == 'vendor_component_apply'}" ng-if="!isPcbStore"><span  ui-sref="vendor_component_apply">器件申请</span></li>-->

+ 7 - 1
src/main/webapp/resources/view/vendor/modal/edit_user_role.html

@@ -12,6 +12,11 @@
         font-size: 14px;
         color: #666;
         margin-left: 14px;
+        cursor: pointer;
+    }
+    .user-role-manage .user-role-header >span.active {
+        color: #5078cb;
+        border-bottom: 2px solid #5078cb;
     }
     .user-role-manage .default-role-area {
         height: 256px;
@@ -173,7 +178,8 @@
 
 <div class="user-role-manage">
     <div class="user-role-header">
-        <span>编辑角色</span>
+        <span ng-class="{active: tab == 'b2c'}" ng-click="switchTab('b2c')">商城角色</span>
+        <span ng-class="{active: tab == 'b2b'}" ng-click="switchTab('b2b')">b2b角色</span>
         <button style=" padding-right:9px; " type="button" class="close" data-dismiss="alert" ng-click="cancelModal()" aria-label="Close">
             <span aria-hidden="true">×</span>
         </button>