Browse Source

主动报警

yangc 8 years ago
parent
commit
60ffcd4e03

+ 24 - 0
src/main/webapp/resources/css/b2bCommon.css

@@ -171,4 +171,28 @@
 .b2b-operate-modal #user-lists table tbody tr td {
     font-size: 14px;
     border: none;
+}
+.b2b-com-head {
+    background: #5078cb;
+    color: #f5f5f5;
+    height: 30px;
+    line-height: 30px;
+    padding-left: 15px;
+    font-size: 14px;
+}
+.b2b-com-title {
+    padding: 21px 7px;
+    font-size: 14px;
+    color: #5078cb;
+    font-weight: bold;
+    position: relative;
+}
+.b2b-com-title::before {
+    content: '';
+    background: #5078cb;
+    width: 3px;
+    height: 14px;
+    position: absolute;
+    left: 0;
+    top: 22px;
 }

+ 122 - 1
src/main/webapp/resources/js/common/b2bServices.js

@@ -383,7 +383,7 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
         }])
         .factory('B2bProduct', ['$resource', 'BaseService', function($resource, BaseService){
             var b2bPath = BaseService.getB2bUrl();
-            return $resource('product', {}, {
+            return $resource(b2bPath + 'product', {}, {
                 vendPord: {
                     url: b2bPath + 'product/vend'
                 }
@@ -570,4 +570,125 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
             }
           });
       }])
+        .factory('B2bQuotation', ['$resource', 'BaseService', function($resource, BaseService) {
+        var b2bPath = BaseService.getB2bUrl();
+        return $resource(b2bPath + 'sale/quotation/info/search', {}, {
+            getTodo: {
+                params: {
+                    _state: 'todo'
+                }
+            },
+            getDone: {
+                params: {
+                    _state: 'done'
+                }
+            },
+            getInvalid: {
+                params: {
+                    _state: 'invalid'
+                }
+            },
+            getAgreed: {
+                params: {
+                    _state: 'agreed'
+                }
+            },
+            getRefused: {
+                params: {
+                    _state: 'refused'
+                }
+            },
+            save: {
+                url: b2bPath + 'sale/quotation/save',
+                method: 'POST',
+                isArray: false,
+                headers: {
+                    'Content-Type': 'application/text;charset=UTF-8'
+                }
+            },
+            submit: {
+                url: b2bPath + 'sale/quotation/submit',
+                method: 'POST',
+                isArray: false,
+                headers: {
+                    'Content-Type': 'application/text;charset=UTF-8'
+                }
+            },
+            getItem: {
+                isArray: false,
+                url: b2bPath + 'sale/quotation/:id/info'
+            },
+            deleteById: {
+                url: b2bPath + 'sale/quotation/deleteById/:id',
+                method: 'DELETE'
+            },
+            exportXls: {
+                url: b2bPath + 'sale/quotation/xls/permission',
+                method: 'GET'
+            }
+        });
+        }])
+        .factory('B2bVendorInfo', ['$resource', 'BaseService', function($resource, BaseService){
+            var b2bPath = BaseService.getB2bUrl();
+            return $resource(b2bPath + 'purchase', {}, {
+                getVendorInfo: {
+                    url: b2bPath + 'purchase/getVendorInfo',
+                    method: 'GET'
+                },
+                getProdInfo: {
+                    url: b2bPath + 'purchase/getProdInfo/:id',
+                    method: 'GET'
+                },
+                customerInfo: {
+                    url: b2bPath + 'purchase/customerInfo/:custuu',
+                    method: 'GET'
+                },
+                relieve: {
+                    url: b2bPath + 'purchase/relieve/:id',
+                    method: 'POST'
+                },
+                activeVend: {
+                    url: b2bPath + 'purchase/activeVend/:id',
+                    method: 'POST'
+                },
+                relieveServicer: {
+                    url: b2bPath + 'purchase/relieveServicer/:id',
+                    method: 'POST'
+                },
+                activeServicer: {
+                    url: b2bPath + 'purchase/activeServicer/:id',
+                    method: 'POST'
+                },
+                disableCust: {
+                    url: b2bPath + 'purchase/disableCust/:id',
+                    method: 'POST'
+                },
+                activeCust: {
+                    url: b2bPath + 'purchase/activeCust/:id',
+                    method: 'POST'
+                }
+            });
+        }])
+        .factory('B2bCurrentRole', ['$resource', 'BaseService', function($resource, BaseService) {
+            var b2bPath = BaseService.getB2bUrl();
+            return $resource(b2bPath + 'account/role', {}, {
+                //当前企业对应的角色是否是销售经理或管理员
+                roles: {
+                    url: b2bPath + 'account/role/currentRole',
+                    method: 'GET'
+                },
+                isManager: {
+                    url: b2bPath + 'account/role/isManager',
+                    method: 'GET'
+                },
+                isUser: {
+                    url: b2bPath + 'account/role/isUser',
+                    method: 'GET'
+                }
+            })
+        }])
+        .factory('B2bCustomer', ['$resource', 'BaseService', function($resource, BaseService){
+            var b2bPath = BaseService.getB2bUrl();
+            return $resource(b2bPath + 'vendor/customer/info/search', {}, {});
+        }]);
 });

+ 10 - 2
src/main/webapp/resources/js/vendor/app.js

@@ -1,4 +1,4 @@
-define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods', 'common/query/rate','common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery','angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage', 'common/query/installments','common/query/product','common/query/seekPurchase','common/query/UASBatchPutOnProperty', 'common/query/authority', 'common/query/attendtion', 'common/b2bServices', 'common/services/File', 'common/services/Token'], function(angularAMD) {
+define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods', 'common/query/rate','common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery','angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage', 'common/query/installments','common/query/product','common/query/seekPurchase','common/query/UASBatchPutOnProperty', 'common/query/authority', 'common/query/attendtion', 'common/b2bServices'], function(angularAMD) {
 	'use strict';
 	/**
 	 * 自定义Array对象的属性last 方法
@@ -8,7 +8,7 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 		return this.length > 0 ? this[this.length - 1] : null;
 	};
 
-	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices','common.query.product', 'ui.tour', 'seekPurchaseServices', 'UASBatchPutOnPropertyModule', 'authorityServices', 'AttendtionServices', 'common.b2bServices', 'FileService', 'TokenService'])
+	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices','common.query.product', 'ui.tour', 'seekPurchaseServices', 'UASBatchPutOnPropertyModule', 'authorityServices', 'AttendtionServices', 'common.b2bServices'])
     app.directive('onFinishRenderFilters', function ($timeout) {
         return {
             restrict: 'A',
@@ -692,6 +692,14 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			templateUrl: 'static/view/vendor/b2b/sale/customer.html',
 			controller: 'CustomerCtrl',
 			controllerUrl: 'app/controllers/b2b/sale/saleCustomerCtrl'
+		})).state('sale_quotation_new', angularAMD.route({
+			url: "/sale/quotation/new",
+			templateUrl: "static/view/vendor/b2b/sale/quotation_new.html",
+			controller: 'SaleQuotationNewCtrl',
+			params: {
+				'inquiryItem': null
+			},
+			controllerUrl: 'app/controllers/b2b/sale/saleQuotationNewCtrl'
 		})).state('sale_customer_detail', angularAMD.route({
 			url: "/sale/customer/:id",
 			templateUrl: "static/view/vendor/b2b/sale/customer_detail.html",

+ 110 - 29
src/main/webapp/resources/js/vendor/controllers/b2b/sale/saleCustomerCtrl.js

@@ -194,41 +194,41 @@ define(['app/app'], function (app) {
         }
     }]);
     // 转移权限
-    app.register.controller('TransferUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'AccountUser', 'toaster', 'AuthenticationService', function ($scope, $modalInstance, customer, AccountUser, toaster, AuthenticationService) {
+    app.register.controller('TransferUserInfoCtrl', ['$scope', '$rootScope', '$modalInstance', 'customer', 'B2bAccountUser', 'toaster', 'AuthenticationService', function ($scope, $rootScope, $modalInstance, customer, AccountUser, toaster, AuthenticationService) {
         AuthenticationService.getAuthentication().success(function (data) {
             $scope.loading = false;
             $scope.thisUser = data;
-        });
-        $scope.checkboxes = {
-            checked: false
-        };
-        $scope.loading = true;
-        $scope.transfer = [];
-        AccountUser.findUsers({uu: customer.myEnterprise.uu}, {}, function (data) {
-            $scope.userinfos = data;
-            var transfer = [];
-            angular.forEach($scope.userinfos, function (user, index) {
-                // 当前用户是被管理员转移权限时,转移的是被管理员转移的权限。
-                if ($scope.thisUser.userUU === user.userUU && user.transfer) {
-                    $scope.thisUser.transfer = true;
-                }
-            });
-            angular.forEach($scope.userinfos, function (user, index) {
-                if ($scope.thisUser.sys || $scope.thisUser.transfer) {
-                    if (user.transfer) {
-                        transfer.push({num: index});
-                        user.checked = true;
+            $scope.checkboxes = {
+                checked: false
+            };
+            $scope.loading = true;
+            $scope.transfer = [];
+            AccountUser.findUsers({uu: customer.myEnterprise.uu}, {}, function (data) {
+                $scope.userinfos = data;
+                var transfer = [];
+                angular.forEach($scope.userinfos, function (user, index) {
+                    // 当前用户是被管理员转移权限时,转移的是被管理员转移的权限。
+                    if ($scope.thisUser.userUU === user.userUU && user.transfer) {
+                        $scope.thisUser.transfer = true;
                     }
-                } else {
-                    if (user.distribute) {
-                        transfer.push({num: index});
-                        user.checked = true;
+                });
+                angular.forEach($scope.userinfos, function (user, index) {
+                    if ($scope.thisUser.sys || $scope.thisUser.transfer) {
+                        if (user.transfer) {
+                            transfer.push({num: index});
+                            user.checked = true;
+                        }
+                    } else {
+                        if (user.distribute) {
+                            transfer.push({num: index});
+                            user.checked = true;
+                        }
                     }
-                }
+                });
+                $scope.transfer = transfer;
+                $scope.havedone = angular.copy($scope.transfer);
+                $scope.loading = false;
             });
-            $scope.transfer = transfer;
-            $scope.havedone = angular.copy($scope.transfer);
-            $scope.loading = false;
         });
 
         var checkStatus = function (userinfos) {
@@ -338,5 +338,86 @@ define(['app/app'], function (app) {
         };
 
     }]);
+    app.register.controller('AddUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'B2bAccountUser', 'toaster', function ($scope, $modalInstance, customer, AccountUser, toaster) {
+        $scope.checkboxes = {
+            checked: false
+        };
+        $scope.loading = true;
+        $scope.distribute = [];
+        AccountUser.findUsers({uu: customer.myEnterprise.uu}, null, function (data) {
+            $scope.userinfos = data;
+            var distribute = [];
+            angular.forEach($scope.userinfos, function (user, index) {
+                if (user.distribute) {
+                    distribute.push({num: index});
+                }
+            });
+            $scope.distribute = distribute;
+            $scope.havedone = angular.copy($scope.distribute);
+            $scope.loading = false;
+        })
+
+        var checkStatus = function (userinfos) {
+            var distribute = [];
+            angular.forEach(userinfos, function (user, index) {
+                if (user.distribute) {
+                    distribute.push({num: index});
+                }
+            });
+            $scope.distribute = distribute;
+            $scope.isChanged = !angular.equals($scope.havedone, $scope.distribute);
+        }
+        $scope.isChanged = false;
+        $scope.isChangedAll = false;
+        $scope.changes = [];
+        // 点击勾选全部的复选框
+        $scope.checkAll = function () {
+            angular.forEach($scope.userinfos, function (item, index) {
+                item.distribute = $scope.checkboxes.checked;
+            });
+            checkStatus($scope.userinfos);
+        };
+
+        // 点击其中一个明细的复选框
+        $scope.checkOne = function () {
+            var result = true;
+            angular.forEach($scope.userinfos, function (item) {
+                if (item.distribute != true) {
+                    result = false;
+                    return;
+                }
+            });
+            $scope.checkboxes.checked = result;
+            checkStatus($scope.userinfos);
+        };
+        $scope.close = function (save) {
+            var chooseResult = [];
+            if (save) {
+                if (customer.myEnterprise.uu) {
+                    angular.forEach($scope.userinfos, function (item, i) {
+                        chooseResult.push(item);
+                    });
+                    if (chooseResult.length > 0) {
+                        $scope.loading = true;
+                        AccountUser.addUserToVendor({uu: customer.myEnterprise.uu}, 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);
+            }
+        };
 
+    }]);
 });

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

@@ -181,7 +181,7 @@ define(['app/app'], function (app) {
         $scope.Quotation = function (uu, id) {
             $rootScope.custuu = uu;
             $rootScope.prodId = id;
-            window.location.hash = "#/sale/quotation/new";
+            window.location.href = "vendor#/sale/quotation/new";
         }
     }]);
 
@@ -211,4 +211,88 @@ define(['app/app'], function (app) {
             $modalInstance.dismiss();
         }
     }]);
+
+    app.register.controller('AddUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'B2bAccountUser', 'toaster', function ($scope, $modalInstance, customer, AccountUser, toaster) {
+        $scope.checkboxes = {
+            checked: false
+        };
+        $scope.loading = true;
+        $scope.distribute = [];
+        AccountUser.findUsers({uu: customer.myEnterprise.uu}, null, function (data) {
+            $scope.userinfos = data;
+            var distribute = [];
+            angular.forEach($scope.userinfos, function (user, index) {
+                if (user.distribute) {
+                    distribute.push({num: index});
+                }
+            });
+            $scope.distribute = distribute;
+            $scope.havedone = angular.copy($scope.distribute);
+            $scope.loading = false;
+        })
+
+        var checkStatus = function (userinfos) {
+            var distribute = [];
+            angular.forEach(userinfos, function (user, index) {
+                if (user.distribute) {
+                    distribute.push({num: index});
+                }
+            });
+            $scope.distribute = distribute;
+            $scope.isChanged = !angular.equals($scope.havedone, $scope.distribute);
+        }
+        $scope.isChanged = false;
+        $scope.isChangedAll = false;
+        $scope.changes = [];
+        // 点击勾选全部的复选框
+        $scope.checkAll = function () {
+            angular.forEach($scope.userinfos, function (item, index) {
+                item.distribute = $scope.checkboxes.checked;
+            });
+            checkStatus($scope.userinfos);
+        };
+
+        // 点击其中一个明细的复选框
+        $scope.checkOne = function () {
+            var result = true;
+            angular.forEach($scope.userinfos, function (item) {
+                if (item.distribute != true) {
+                    result = false;
+                    return;
+                }
+            });
+            $scope.checkboxes.checked = result;
+            checkStatus($scope.userinfos);
+        };
+        $scope.close = function (save) {
+            var chooseResult = [];
+            if (save) {
+                if (customer.myEnterprise.uu) {
+                    angular.forEach($scope.userinfos, function (item, i) {
+                        chooseResult.push(item);
+                    });
+                    if (chooseResult.length > 0) {
+                        $scope.loading = true;
+                        AccountUser.addUserToVendor({uu: customer.myEnterprise.uu}, 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);
+            }
+        };
+
+    }]);
+
 });

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

@@ -0,0 +1,339 @@
+define(['app/app'], function (app) {
+    "use strict";
+    // Controller 主动报价 - 新增
+    app.register.controller('SaleQuotationNewCtrl', ['$scope', '$stateParams', '$filter', 'ngTableParams', 'toaster', 'BaseService', '$modal', 'B2bQuotation', 'B2bVendorInfo', '$rootScope', 'B2bCurrentRole', function ($scope, $stateParams, $filter, ngTableParams, toaster, BaseService, $modal, Quotation, VendorInfo, $rootScope, CurrentRole) {
+        BaseService.scrollBackToTop();
+
+        // 获取当前用户是否为普通用户
+        CurrentRole.isUser({}, {}, function (data) {
+            $scope.isUser = data.isUser;
+        });
+
+        var staticItem = null;
+
+        if (!angular.isUndefined($stateParams.id)) {// 查看模式
+            $scope.loading = true;
+            $rootScope.enteryStatus = true;
+            Quotation.getItem({id: $stateParams.id}, function (data) {
+                // data.$editing = false;
+                $scope.item = data;
+                $scope.item.$editing = true; // 取消要点击修改才可以编辑的交互
+                staticItem = angular.copy(data);
+                $scope.loading = false;
+            }, function (response) {
+                $scope.loading = false;
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        } else {// 新增模式
+            $rootScope.enteryStatus = false;
+            $scope.item = {
+                quotation: {
+                    currency: 'RMB',
+                    taxrate: 17,
+                },
+                product: {},
+                prices: [{lapQty: 0}],
+                minOrderQty: 1,
+                minPackQty: 1,
+                $endDateOpen: false,
+                $editing: true
+            };
+        }
+
+        $scope.getMinDate = function (item) {
+            return $filter('date')(new Date, 'yyyy-MM-dd');
+        };
+
+        //是否不能被点击
+        $scope.isDisabled = function () {
+            return $scope.item.quotation.status == 101 && $scope.item.agreed == null;
+        }
+
+        $scope.openDatePicker = function ($event, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            $scope.item.$endDateOpen = !openParam;
+        };
+
+        // 增加一个分段
+        $scope.addPrice = function () {
+            if ($scope.item.prices.length >= 10) {
+                toaster.pop('warning', '提示', '最多支持10个分段!');
+            } else
+                $scope.item.prices.push({});
+        };
+
+        // 删除一个分段
+        $scope.removePrice = function (index) {
+            $scope.item.prices.splice(index, 1);
+        };
+
+        // 查找客户
+        $scope.dbfindCust = function () {
+            if ($scope.item.$editing) {
+                var modalInstance = $modal.open({
+                    templateUrl: 'static/view/vendor/b2b/modal/quotation_new_cust.html',
+                    controller: 'DbfindCustCtrl',
+                    size: 'lg',
+                    resolve: {}
+                });
+
+                modalInstance.result.then(function (data) {
+                    $scope.item.quotation.cust = data.myEnterprise;
+                    $scope.item.quotation.custUser = data.myUser;
+                    $scope.item.product = null;
+                }, function () {
+
+                });
+            }
+        };
+
+        // 赋值客户信息
+        if ($rootScope.custuu) {
+            VendorInfo.customerInfo({custuu: $rootScope.custuu}, {}, function (data) {
+                $scope.item.quotation.cust = data.myEnterprise;
+                $scope.item.quotation.custUser = data.myUser;
+            })
+        }
+
+        // 赋值物料信息
+        if ($rootScope.prodId) {
+            VendorInfo.getProdInfo({id: $rootScope.prodId}, {}, function (data) {
+                $scope.item.product.code = data.code;
+                $scope.item.product.title = data.title;
+                $scope.item.product.spec = data.spec;
+                $scope.item.product.unit = data.unit;
+                $scope.item.product.id = data.id;
+            }, function (response) {
+
+            });
+        }
+        // 查找客户物料
+        $scope.dbfindCustProd = function () {
+            if ($scope.item.$editing) {
+                if ($scope.item.quotation.cust) {
+                    var modalInstance = $modal.open({
+                        templateUrl: 'static/view/vendor/b2b/modal/quotation_new_custProd.html',
+                        controller: 'DbfindCustProdCtrl',
+                        size: 'lg',
+                        resolve: {
+                            custUU: function () {
+                                return $scope.item.quotation.cust.uu
+                            }
+                        }
+                    });
+
+                    modalInstance.result.then(function (data) {
+                        $scope.item.product = data;
+                    }, function () {
+
+                    });
+                } else {
+                    toaster.pop('error', '错误', '请先选择客户');
+                }
+            }
+        };
+
+        // 根据传入的询价相关的信息封装成报价需要的信息
+        if ($stateParams.inquiryItem != null) {
+            var item = $stateParams.inquiryItem;
+            $scope.item.quotation.cust = item.inquiry.enterprise;
+            $scope.item.quotation.custUser = item.inquiry.recorderUser;
+            $scope.item.quotation.custUserUU = item.inquiry.recorderUU;
+            if (item.product == null || item.product.id == null) {
+                toaster.pop('info', '暂未匹配到物料信息,请手动选择');
+            } else {
+                $scope.item.product = item.product;
+                if (item.replies.length > 0) {
+                    $scope.item.prices = item.replies;
+                    angular.forEach($scope.item.prices, function(price) {
+                        price.id = null;
+                    });
+                }
+                $scope.item.quotation.taxrate = item.taxrate;
+                $scope.item.minPackQty = item.minPackQty;
+                $scope.item.minOrderQty = item.minOrderQty;
+                $scope.item.leadtime = item.leadtime;
+                $scope.item.quotation.currency = item.currency;
+            }
+        }
+
+        // 保存
+        $scope.save = function () {
+            var valid = true;
+            angular.forEach($scope.item.prices, function(price, $index) {
+                if ($index > 0 && price.lapQty <= $scope.item.prices[$index - 1].lapQty) {
+                    valid = false;
+                }
+            });
+            if (!valid) {
+                toaster.pop('info', '提示', '分段数量请保持递增!');
+            } else {
+                $scope.loading = true;
+                if (!$scope.item.quotation.code) //新增,设单号
+                    $scope.item.quotation.code = 'BJ' + $filter('date')(new Date(), 'yyMMddHHmmss_sss');
+                $scope.item.quotation.custUU = $scope.item.quotation.cust.uu;
+                if ($scope.item.quotation.custUserUU == null) {
+                    $scope.item.quotation.custUserUU = $scope.item.quotation.custUser.userUU;
+                }
+                $scope.item.productId = $scope.item.product.id;
+                Quotation.save({}, $scope.item, function (data) {
+                    $scope.loading = false;
+                    $scope.item = data;
+                    toaster.pop('success', '成功', '保存成功');
+                    if ($stateParams.id)
+                        window.location.reload();
+                    else
+                        window.location.hash = '#/sale/quotation/list';
+                }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '保存失败', response.data);
+                });
+            }
+        };
+        // 更新
+        $scope.update = function () {
+            $scope.item.$editing = true;
+        };
+
+        // 取消
+        $scope.cancel = function () {
+            $scope.item.$editing = false;
+            $scope.item = angular.copy(staticItem);
+        };
+
+        // 提交
+        $scope.submit = function () {
+            var valid = true;
+            angular.forEach($scope.item.prices, function(price, $index) {
+                if ($index > 0 && price.lapQty <= $scope.item.prices[$index - 1].lapQty) {
+                    valid = false;
+                }
+            });
+            if (!valid) {
+                toaster.pop('info', '提示', '分段数量请保持递增!');
+            } else {
+                $scope.loading = true;
+                if (!$scope.item.quotation.code) //新增,设单号
+                    $scope.item.quotation.code = 'BJ' + $filter('date')(new Date(), 'yyMMddHHmmss_sss');
+                $scope.item.quotation.custUU = $scope.item.quotation.cust.uu;
+                if ($scope.item.quotation.custUserUU == null) {
+                    $scope.item.quotation.custUserUU = $scope.item.quotation.custUser.userUU;
+                }
+                $scope.item.productId = $scope.item.product.id;
+                // $scope.item.quotation.status = 101;//已提交
+                if ($scope.item.quotation.date instanceof Date) {
+                    $scope.item.quotation.date = $scope.item.quotation.date.getTime();
+                }
+                if ($scope.item.quotation.endDate instanceof Date) {
+                    $scope.item.quotation.endDate = $scope.item.quotation.endDate.getTime();
+                }
+                Quotation.submit({}, $scope.item, function (data) {
+                    $scope.loading = false;
+                    $scope.item = data;
+                    toaster.pop('success', '成功', '提交成功');
+                    // window.location.hash = '#/sale/quotation/' + data.id;
+                    window.location.hash = '#/sale/quotation/list';
+                }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '保存失败', response.data);
+                });
+            }
+        };
+
+        $scope.deleteById = function (id) {
+            Quotation.deleteById({id: id}, {}, function (data) {
+                window.location.href = "#/sale/quotation/list";
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            })
+        }
+    }]);
+
+    // 查找客户
+    app.register.controller('DbfindCustCtrl', ['$scope', 'B2bCustomer', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', function ($scope, Customer, BaseService, ngTableParams, toaster, $modalInstance) {
+        BaseService.scrollBackToTop();
+        $scope.tableParams = new ngTableParams({
+            page: 1,
+            count: 20
+        }, {
+            total: 0,
+            counts: [5, 10, 25, 50],
+            getData: function ($defer, params) {
+                $scope.loading = true;
+                var pageParams = params.url();
+                pageParams.keyword = $scope.keyword;
+                Customer.get(BaseService.parseParams(pageParams), function (page) {
+                    $scope.loading = false;
+                    if (page) {
+                        params.total(page.totalElement);
+                        $defer.resolve(page.content);
+                    }
+                    $scope.totalCount = page.totalElement;
+                }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '数据加载失败', response.data);
+                });
+            }
+        });
+
+        $scope.onSearch = function () {
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+
+        $scope.cancel = function () {
+            $modalInstance.dismiss();
+        };
+
+        $scope.check = function (cust) {
+            $modalInstance.close(cust);
+        };
+    }]);
+
+    // 查找客户物料
+    app.register.controller('DbfindCustProdCtrl', ['$scope', 'B2bProduct', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'custUU', function ($scope, Product, BaseService, ngTableParams, toaster, $modalInstance, custUU) {
+        BaseService.scrollBackToTop();
+        $scope.tableParams = new ngTableParams({
+            page: 1,
+            count: 20
+        }, {
+            total: 0,
+            counts: [5, 10, 25, 50],
+            getData: function ($defer, params) {
+                $scope.loading = true;
+                var pageParams = params.url();
+                pageParams.keyword = $scope.keyword;
+                pageParams.custUU = custUU;
+                Product.get.call(null, BaseService.parseParams(pageParams), function (page) {
+                    $scope.loading = false;
+                    if (page) {
+                        params.total(page.totalElement);
+                        $defer.resolve(page.content);
+                        $scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
+                    }
+                }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '数据加载失败', response.data);
+                });
+            }
+        });
+
+        // 取消
+        $scope.cancel = function () {
+            $modalInstance.dismiss();
+        };
+
+        // 选择
+        $scope.check = function (cust) {
+            $modalInstance.close(cust);
+        };
+
+        // 搜索框回车
+        $scope.onSearch = function () {
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+    }]);
+
+});

+ 44 - 0
src/main/webapp/resources/view/vendor/b2b/modal/quotation_new_cust.html

@@ -0,0 +1,44 @@
+<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="cancel()"></i>
+	</p>
+	<div class="modal-body" style="min-height: 500px; padding-top: 0;">
+		<form class="form-horizontal">
+			<div class="form-group" id="window-search">
+				<div class="col-md-2 col-sm-2"></div>
+				<div class="col-md-8 col-sm-8">
+					<input type="search" class="form-control input-sm" ng-model="keyword" ng-search="onSearch()" placeholder="输入企业名称、简称搜索" />
+					<a class="btn input-group-addon" ng-click="onSearch()">搜索</a>
+				</div>
+			</div>
+		</form>
+		<table class="block table table-default table-striped table-bordered"
+			   ng-table="tableParams">
+			<thead>
+			<tr class="header">
+				<th>UU</th>
+				<th>客户名称</th>
+				<th>地址</th>
+				<th>选择</th>
+			</tr>
+			</thead>
+			<tbody>
+			<tr ng-repeat="customer in $data">
+				<td class="text-center"><a ng-click="check(customer)" ng-bind="::customer.myEnterprise.uu"></a></td>
+				<td class="text-center"><a ng-click="check(customer)" ng-bind="::customer.myEnterprise.enName"></a></td>
+				<td class="text-center"><a ng-bind="::customer.myEnterprise.enAddress" ng-click="check(customer)"></a></td>
+				<td class="text-center"><a title="选择" href="javascript:void(0)" ng-click="check(customer)">选择</a></td>
+			</tr>
+			</tbody>
+		</table>
+	</div>
+	<div class="modal-footer">
+		<button class="btn btn-default" ng-click="cancel()" type="button">取消</button>
+	</div>
+</div>

+ 48 - 0
src/main/webapp/resources/view/vendor/b2b/modal/quotation_new_custProd.html

@@ -0,0 +1,48 @@
+<style>
+	.modal-content {
+		max-height: 500px;
+		overflow-y: auto;
+	}
+</style>
+<div class=""></div>
+<div class="modal-body" style="min-height: 500px; padding-top: 0;">
+	<div class="modal-header" style="margin-bottom: 10px;">
+		<h3 class="modal-title">
+			<span>主动报价 - 选择客户物料</span>
+		</h3>
+	</div>
+	<form class="form-horizontal">
+		<div class="form-group" id="window-search">
+			<div class="col-md-2 col-sm-2"></div>
+			<div class="col-md-8 col-sm-8">
+				<input ng-model="keyword" type="text" class="form-control input-sm" 
+					required placeholder="输入客户物料关键字查询" autofocus ng-search="onSearch()">
+				<a class="btn input-group-addon" ng-click="onSearch()">搜索</a>
+			</div>
+		</div>
+	</form>
+	<table class="block table table-default table-striped table-bordered"
+		ng-table="tableParams">
+		<thead>
+			<tr class="header">
+				<th width="160px">编号</th>
+				<th width="160px">名称</th>
+				<th>规格</th>
+				<th width="80px">单位</th>
+				<th width="50px">选择</th>
+			</tr>
+		</thead>
+		<tbody>
+			<tr ng-repeat="product in $data">
+				<td class="text-center"><a ng-click="check(product)" ng-bind="::product.code"></a></td>
+				<td class="text-center"><a ng-click="check(product)" ng-bind="::product.title"></a></td>
+				<td class="text-left f12"><a ng-click="check(product)" ng-bind="::product.spec"></a></td>
+				<td class="text-center"><a ng-click="check(product)" ng-bind="::product.unit"></a></td>
+				<td class="text-center"><a title="选择" href="javascript:void(0)" ng-click="check(product)">选择</a></td>
+			</tr>
+		</tbody>
+	</table>
+</div>
+<div class="modal-footer">
+	<button class="btn btn-default" ng-click="cancel()" type="button">取消</button>
+</div>

+ 44 - 42
src/main/webapp/resources/view/vendor/b2b/sale/customer_detail.html

@@ -162,49 +162,51 @@
                 <i class="fa fa-fw" ng-class="{'fa-angle-up': $open, 'fa-angle-down': !$open}"></i>
             </a>
         </div>
-        <div class="b2b-com-search search" >
-            <div class="search-result fl"><i class="fa fa-search"></i>  搜索“{{tip}}”,为您找到<em>{{total || 0}}</em>个结果</div>
-            <div class="search-content fr">
-                <input type="text" placeholder="输入供应商物料关键字查询" ng-model="keyword" autofocus ng-search="onSearch(keyword)"/>
-                <a class="seek" ng-click="onSearch(keyword)">搜索</a>
+        <div ng-if="$open">
+            <div class="b2b-com-search search" >
+                <div class="search-result fl"><i class="fa fa-search"></i>  搜索“{{tip}}”,为您找到<em>{{total || 0}}</em>个结果</div>
+                <div class="search-content fr">
+                    <input type="text" placeholder="输入供应商物料关键字查询" ng-model="keyword" autofocus ng-search="onSearch(keyword)"/>
+                    <a class="seek" ng-click="onSearch(keyword)">搜索</a>
+                </div>
             </div>
-        </div>
-        <table class="b2b-com-table" ng-table="tableParams" >
-            <thead>
-            <tr>
-                <th width="160">编号</th>
-                <th width="200">名称</th>
-                <th>规格</th>
-                <th width="80">单位</th>
-                <th width="80">操作</th>
-            </tr>
-            </thead>
-            <tbody ng-if="tableParams.total() == 0">
-            <tr>
-                <td colspan="5">
-                    <div id="empty">
-                        <div class="left_img">
-                            <a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
-                            <a href="#/index" title="B2B商务首页">B2B 商务</a>
+            <table class="b2b-com-table" ng-table="tableParams" >
+                <thead>
+                <tr>
+                    <th width="160">编号</th>
+                    <th width="200">名称</th>
+                    <th>规格</th>
+                    <th width="80">单位</th>
+                    <th width="80">操作</th>
+                </tr>
+                </thead>
+                <tbody ng-if="tableParams.total() == 0">
+                <tr>
+                    <td colspan="5">
+                        <div id="empty">
+                            <div class="left_img">
+                                <a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
+                                <a href="#/index" title="B2B商务首页">B2B 商务</a>
+                            </div>
+                            <div class="right_link">
+                                <p ng-if="tip != null">搜索"{{tip}}"未找到产品信息,请重新输入搜索条件</p>
+                                <p ng-if="tip == null">您的客户还未添加商品信息,请尽快通知客户</p>
+                            </div>
                         </div>
-                        <div class="right_link">
-                            <p ng-if="tip != null">搜索"{{tip}}"未找到产品信息,请重新输入搜索条件</p>
-                            <p ng-if="tip == null">您的客户还未添加商品信息,请尽快通知客户</p>
-                        </div>
-                    </div>
-                </td>
-            </tr>
-            </tbody>
-            <tbody>
-            <tr ng-repeat="product in $data">
-                <td class="text-center" ng-bind="::product.code"></td>
-                <td class="text-center" ng-bind="::product.title"></td>
-                <td class="text-center f12" ng-bind="::product.spec"></td>
-                <td class="text-center" ng-bind="::product.unit"></td>
-                <td class="text-center td-operate" ><a title="主动报价" href="javascript:void(0)" style="text-decoration: none; color: #3f84f6;" id="click" class="add01" ng-click="Quotation(customer.uu, product.id)">报价</a>
-                </td>
-            </tr>
-            </tbody>
-        </table>
+                    </td>
+                </tr>
+                </tbody>
+                <tbody>
+                <tr ng-repeat="product in $data">
+                    <td class="text-center" ng-bind="::product.code"></td>
+                    <td class="text-center" ng-bind="::product.title"></td>
+                    <td class="text-center f12" ng-bind="::product.spec"></td>
+                    <td class="text-center" ng-bind="::product.unit"></td>
+                    <td class="text-center td-operate" ><a title="主动报价" href="javascript:void(0)" style="text-decoration: none; color: #3f84f6;" id="click" class="add01" ng-click="Quotation(customer.uu, product.id)">报价</a>
+                    </td>
+                </tr>
+                </tbody>
+            </table>
+        </div>
     </div>
 </div>

+ 504 - 0
src/main/webapp/resources/view/vendor/b2b/sale/quotation_new.html

@@ -0,0 +1,504 @@
+<style>
+	.new {
+		padding: 0px 40px 20px 20px;
+		margin-top: 20px;
+	}
+
+	.new label {
+		font-size: 14px;
+		font-weight: normal;
+		font-family: "Microsoft YaHei" ! important;
+	}
+
+	.headerline {
+		font-size: 16px;
+		font-family: Microsoft YaHei,SimHei,Verdana;
+		font-weight: 500;
+		line-height: 22px;
+		margin: 25px 0;
+		clear: both;
+		zoom: 1;
+		border-top: 1px solid #eee;
+		position: relative;
+	}
+
+	.headerline .content {
+		position: absolute;
+		top: -12px;
+		left: -24px;
+		line-height: 24px;
+		padding: 0 15px 0 10px;
+		background: #fff;
+		z-index: 2;
+	}
+
+	.headerline .end {
+		position: absolute;
+		top: -12px;
+		right: 20px;
+		line-height: 24px;
+		padding-left: 15px;
+		background: #fff;
+		z-index: 2;
+	}
+
+	.input-group-addon {
+		background-color: inherit;
+		border: 1px solid #e1e1e1;
+		color: #888 !important;
+	}
+
+	.status {
+		position: absolute;
+		top: -10px;
+		right: 5px;
+		background-color: #fff;
+		border: 1px solid;
+		padding: 3px 14px;
+		font-size: 16px;
+		font-family: "LiShu";
+		border-radius: 10px;
+		-moz-transform: rotate(-10deg);
+		-webkit-transform: rotate(-10deg);
+		-o-transform: rotate(-10deg);
+		transform: rotate(-10deg);
+		border-radius: 10px;
+		opacity: 0.7;
+		white-space: nowrap;
+	}
+	.num-ctrl{
+		width: 60px;
+		padding: 0 !important;
+		line-height: 34px;
+	}
+	.title-div {
+		font-size: 14px;
+		font-weight: 600;
+		padding-left: 20px;
+		height: 50px;
+		padding-top: 11px;
+	}
+	.form-horizontal .control-label{
+		text-align: left;
+		padding: 0;
+		font-size: 14px !important;
+	}
+	.form-horizontal .form-control{
+		border: #bfbfbf 1px solid !important;
+		height: 34px;
+		background: #fff;
+		font-size: 14px;
+	}
+	.form-horizontal .input-group-btn button{
+		height: 34px;
+		border: #bfbfbf 1px solid !important;
+		background: #bfbfbf;
+		font-size: 14px;
+		color: #fff;
+	}
+	.customer-input{
+		border: #bfbfbf 1px solid !important;
+		height: 34px;
+		background: #fff;
+		font-size: 14px;
+		border-radius: 5px;
+		width: 100%;
+		display: inline-block;
+		color: #323232;
+		line-height: 34px;
+		padding-left: 10px;
+	}
+	/*sssssssssssssssssss*/
+	.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;
+	}
+
+	.input-dbfind {
+		cursor: pointer;
+	}
+
+	@media ( min-width : 768px) {
+		.form-horizontal .form-group-xs .control-label {
+			padding-top: 5px;
+		}
+	}
+
+	.inline-show {
+		display: inline-block;
+	}
+
+	.inline-hide {
+		display: none;
+	}
+	.btn-group-justified .btn{
+		border: none;
+		font-size: 14px;
+		outline: none;
+	}
+	.btn-group-justified .btn-info{
+		background: none;
+		color: #3a89d1;
+	}
+	.btn-group-justified .btn:hover{
+		background: none;
+		color: #3a89d1;
+	}
+	.btn-group-justified .btn:active{
+		background: none;
+	}
+	.pub-com_head  .p-right a.btn-info{
+		background: none;
+		color: #999;
+		cursor: default;
+	}
+	.pub-com_head  .p-right a.btn-info:hover{
+		text-decoration: none;
+		color: #999;
+	}
+	.pub-com_head  .time-per{
+		margin-right: 20px;
+		color: #fff !important;
+		float: right;
+	}
+	.pub-com_head  .time-per em,.pub-com_head  .time-per time{
+		font-style : normal;
+		font-size: 14px;
+		color:#fff;
+		margin-right: 20px;
+	}
+	.pub-com_head span.fr em {
+		margin-right: 50px;
+		font-size: 14px;
+		color:#fff;
+	}
+	.quot-new .content-wrap {
+		background: #fff;
+		padding: 0 0 0 19px;
+	}
+	.quot-new .form-control {
+		padding: 0 10px;
+	}
+	.quot-new .btn-wrap {
+		margin-top: 20px;
+		padding-top: 27px;
+		border-top: 2px solid #f5f5f5;
+		text-align: center;
+	}
+	.quot-new .btn-wrap button {
+		margin-right: 10px;
+	}
+	.quot-new .btn-wrap button:last-child {
+		margin-right: 0;
+	}
+	.quot-new .text-simple {
+		background: #e5e4e4;
+		width: 38px !important;
+		height: 34px !important;
+		border: 1px solid #ccc;
+		border-radius: 0 2px 2px 0;
+	}
+</style>
+<div class="user_right fr quot-new">
+	<div class="block">
+		<div class="pub-com_head" ng-controller="SaleQuotationNewCtrl">
+			<div class="b2b-com-head">主动报价</div>
+			<!-- <div class="p-right" ng-if="!enteryStatus">
+                <a  ui-sref="sale.quotation.new" ui-sref-active="btn-info">
+                    <i class="fa fa-plus-square-o"></i> 新增
+                </a>
+                <!--<a ui-sref="sale.quotation.list" ui-sref-active="btn-info">-->
+			<!--<i class="fa fa-list"></i> 列表-->
+			<!--</a>-->
+			<span class="time-per fr"><em>录入人:{{::item.quotation.user.userName}}</em><time>日期:{{::item.quotation.date | date:'yyyy-MM-dd HH:mm:ss'}}</time></span>
+		</div>
+	</div>
+	<div class="content-wrap">
+		<div class="b2b-com-title">基本信息</div>
+		<div class="dot block new">
+			<form class="form-horizontal" name="quotationForm">
+				<div style="position: relative;">
+					<div ng-if="item.quotation.status == 100" class="status">在录入</div>
+					<div ng-if="item.quotation.status == 101 && item.agreed == null" class="status">已提交</div>
+					<div ng-if="item.quotation.status == 101 && item.agreed == 1" class="status">报价已采纳</div>
+					<div ng-if="item.quotation.status == 101 && item.agreed == 0" class="status">报价未采纳</div>
+				</div>
+				<!-- <div class="form-group form-group-sm" ng-if="item.quotation.code">
+                    <label class="col-sm-2 text-right">单据时间:</label>
+                    <div class="col-sm-4">
+                        <div class="" style="font-size: 14px;">
+                            {{::item.quotation.date | date:'yyyy-MM-dd HH:mm:ss'}}
+                        </div>
+                    </div>
+                    <label class="col-sm-2 text-right">录入人:</label>
+                    <div class="col-sm-2">
+                        <div class="" style="font-size: 14px;">
+                            {{::item.quotation.user.userName}}
+                        </div>
+                    </div>
+                </div> -->
+				<div class="form-group form-group-sm" ng-if="item.quotation.code">
+					<label for="code" class="col-sm-2 control-label">单据编号:</label>
+					<div class="col-sm-4">
+						<div class="">
+							<input ng-model="item.quotation.code" readonly="readonly" type="text" class="form-control" id="code"
+							>
+						</div>
+					</div>
+				</div>
+				<div class="form-group form-group-sm has-feedback">
+					<label for="customer" class="col-sm-2 control-label"><span class="text-inverse text-bold">* </span>客户:</label>
+					<div class="col-sm-4">
+						<div class="">
+							<input ng-model="item.quotation.cust.enName" readonly="readonly" type="text" class="form-control" id="customer"
+								   placeholder="点击选择客户" style="cursor: pointer;" ng-click="dbfindCust()" ng-required="true" ng-disabled="isDisabled()">
+							<span class="form-control-feedback text-simple" ng-if="item.$editing"><i class="fa fa-search"></i></span>
+						</div>
+						<!--<div ng-if="item.quotation.cust.enAddress" class="text-muted">
+                            <i class="fa fa-map-marker fa-fw"></i> {{item.quotation.cust.enAddress}}
+                        </div>-->
+					</div>
+					<label for="customerUser" class="col-sm-2 control-label">客户联系人:</label>
+					<div class="col-sm-4">
+						<div class="">
+							<input ng-model="item.quotation.custUser.userName" type="text" class="form-control input-dbfind" id="custUser"
+								   placeholder="点击选择客户联系人" readonly="readonly" style="cursor: pointer;display: none">
+							<span class="customer-input">{{item.quotation.custUser.userName}} {{item.quotation.custUser.userTel}}</span>
+						</div>
+					</div>
+				</div>
+				<div class="form-group form-group-sm has-feedback">
+					<label for="product" class="col-sm-2 control-label"><span class="text-inverse text-bold">* </span>产品编号:</label>
+					<div class="col-sm-4">
+						<div class="">
+							<input ng-model="item.product.code" type="text" class="form-control input-dbfind" id="product"
+								   placeholder="点击选择产品" readonly="readonly" style="cursor: pointer;"
+								   ng-click="dbfindCustProd()" ng-required="true" ng-disabled="isDisabled()">
+							<span class="form-control-feedback text-simple"  ng-if="item.$editing"><i class="fa fa-search"></i></span>
+						</div>
+					</div>
+					<label for="product" class="col-sm-2 control-label"><span class="text-inverse text-bold">* </span>产品名称:</label>
+					<div class="col-sm-4">
+						<div class="">
+							<input ng-model="item.product.title" type="text" class="form-control input-dbfind" id="product"
+								   placeholder="" readonly="readonly" style="cursor: pointer;"
+								   ng-required="true">
+						</div>
+					</div>
+				</div>
+				<div class="form-group form-group-sm has-feedback">
+					<label for="product" class="col-sm-2 control-label">产品规格:</label>
+					<div class="col-sm-10">
+						<div class="">
+							<input ng-model="item.product.spec" type="text" class="form-control input-dbfind" id="product"
+								   placeholder="" readonly="readonly" style="cursor: pointer;">
+						</div>
+					</div>
+				</div>
+				<div class="form-group form-group-sm">
+					<label for="brand" class="col-sm-2 control-label">品牌:</label>
+					<div class="col-sm-4">
+						<input ng-model="item.brand" type="text" class="form-control" id="brand"
+							   placeholder="" ng-readonly="!item.$editing" ng-disabled="isDisabled()">
+					</div>
+					<label class="col-sm-2 control-label">单位:</label>
+					<div class="col-sm-4">
+						<input ng-model="item.product.unit" type="text" class="form-control input-dbfind" id="product"
+							   placeholder="" readonly="readonly" style="cursor: pointer;"
+							   ng-required="true">
+					</div>
+				</div>
+				<div class="form-group form-group-sm">
+					<label for="minPackQty" class="col-sm-2 control-label"><span class="text-inverse text-bold">* </span>最小包装量:</label>
+					<div class="col-sm-4">
+						<input ng-model="item.minPackQty" type="number" class="form-control" id="minPackQty"
+							   placeholder="最小包装量" ng-readonly="!item.$editing" ng-required="true" ng-disabled="isDisabled()">
+					</div>
+					<label for="minOrderQty" class="col-sm-2 control-label"><span class="text-inverse text-bold">* </span>最小订购量:</label>
+					<div class="col-sm-4">
+						<input ng-model="item.minOrderQty" type="number" class="form-control" id="minOrderQty"
+							   placeholder="最小订购量" ng-readonly="!item.$editing" ng-required="true" ng-disabled="isDisabled()">
+					</div>
+				</div>
+				<div class="form-group form-group-sm">
+					<label for="leadtime" class="col-sm-2 control-label"><span class="text-inverse text-bold">* </span>交货周期(天):</label>
+					<div class="col-sm-4">
+						<input ng-model="item.leadtime" type="number" class="form-control" id="leadtime" ng-pattern="/^[0-9]*[1-9][0-9]*$/"
+							   placeholder="只可以为正整数" ng-readonly="!item.$editing" ng-required="true" ng-disabled="isDisabled()">
+					</div>
+					<!--<label class="col-sm-2 control-label">价格有效日期:</label>
+                    <div class="col-sm-4">
+                        <div class="input-group">
+                            <input ng-model="item.quotation.endDate" type="text" class="form-control" id="endDate"
+                                   placeholder="" datepicker-popup="yyyy-MM-dd" is-open="item.$endDateOpen"
+                                   min-date="getMinDate()" ng-required="true" ng-disabled="true"
+                                   current-text="今天" clear-text="清除" close-text="关闭"
+                                   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                                   ng-focus="openDatePicker($event, item.$endDateOpen)" ng-readonly="!item.$editing">
+                            <span class="input-group-btn">
+                                <button type="button" class="btn btn-default btn-sm" ng-disabled="!item.$editing || isDisabled()"
+                                        ng-click="openDatePicker($event, item.$endDateOpen)" >
+                                    <i class="fa fa-calendar"></i>
+                                </button>
+                            </span>
+                            <span class="text-inverse text-bold" style="right:-10px">* </span>
+                        </div>
+                    </div>-->
+				</div>
+				<div class="form-group form-group-sm">
+					<label for="currency" class="col-sm-2 control-label"><span class="text-inverse text-bold">* </span>币别:</label>
+					<div class="col-sm-4">
+						<select ng-model="item.quotation.currency" class="form-control select-adder" id="currency" ng-readonly="!item.$editing" ng-disabled="isDisabled()">
+							<option value="RMB">RMB</option>
+							<option value="USD">USD</option>
+							<option value="EUR">EUR</option>
+							<option value="HKD">HKD</option>
+						</select>
+					</div>
+					<label for="taxrate" class="col-sm-2 control-label"><span class="text-inverse text-bold">* </span>税率:</label>
+					<div class="col-sm-4">
+						<input ng-model="item.quotation.taxrate" type="text" class="form-control" id="taxrate"
+							   placeholder="税率" ng-readonly="!item.$editing" ng-required="true" ng-disabled="isDisabled()">
+					</div>
+				</div>
+				<div class="form-group form-group-sm">
+					<label for="remark" class="col-sm-2 control-label">备注:</label>
+					<div class="col-sm-10">
+				<textarea ng-model="item.quotation.remark" class="form-control" rows="3" cols="3" id="remark"
+						  placeholder="" ng-readonly="!item.$editing" ng-disabled="isDisabled()">
+				</textarea>
+					</div>
+				</div>
+				<div class="headerline">
+					<div class="content"><span class="text-inverse text-bold">* </span>分段价格信息</div>
+				</div>
+				<div class="form-group form-group-sm" ng-repeat="price in item.prices">
+					<label class="col-sm-2 control-label">分段 {{$index + 1}}</label>
+					<label for="qty{{$index + 1}}" class="num-ctrl col-sm-1 control-label" style="width: 60px;">数量</label>
+					<div class="col-sm-3">
+						<div class="input-group">
+							<div class="input-group-addon">≥</div>
+							<input ng-model="price.lapQty" type="number" class="form-control" id="qty{{$index + 1}}"
+								   placeholder="最小数量" ng-readonly="$first || !item.$editing" ng-required="true"
+								   ng-disabled="isDisabled()">
+							<div class="input-group-addon">{{item.product.unit}}</div>
+						</div>
+					</div>
+					<label for="price{{$index + 1}}" class="num-ctrl col-sm-1 control-label" style="text-align: right;">单价</label>
+					<div class="col-sm-2">
+						<input ng-model="price.price" type="text" class="form-control" id="price{{$index + 1}}" placeholder="单价"
+							   ng-pattern="/^[1-9]\d*\.{0,1}\d*|0\.\d*[1-9]\d*$/" ng-readonly="!item.$editing" ng-required="true"
+							   ng-disabled="isDisabled()" ng-init="price.price = (isUser?'-':price.price)">
+					</div>
+					<label class="col-sm-3" style="line-height: 30px;" ng-hide = "isDisabled()">
+						<a ng-if="!$first && item.$editing" href="javascript:void(0)" ng-click="removePrice($index)" class="red"><i class="fa fa-trash-o"></i> 删除</a>&nbsp;&nbsp;&nbsp;
+						<a ng-if="$last && item.$editing" href="javascript:void(0)" ng-click="addPrice()" class="blue"><i class="fa fa-plus-square fa-fw"></i> 增加</a>
+					</label>
+				</div>
+				<div class="btn-wrap">
+					<button ng-if="item.$editing && item.quotation.status != 101  && item.agreed == null" class="b2b-btn b2b-btn-submit" ng-disabled="quotationForm.$invalid" ng-click="save()">保存</button>
+					<button ng-if="item.quotation.status != 101 && item.agreed == null" class="b2b-btn b2b-btn-submit" ng-disabled="quotationForm.$invalid" ng-click="submit()">提交</button>
+					<button ng-if="item.quotation.status == 100" class="b2b-btn b2b-btn-cancel" ng-click="deleteById(item.quotation.id)" ng-if="item.quotation.status == 100">删除</button>
+				</div>
+			</form>
+		</div>
+	</div>
+</div>