|
|
@@ -9893,8 +9893,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
ShipAddress.saveAddress( {}, ship, function(data) {
|
|
|
if(data.success) {
|
|
|
toaster.pop('success', '提示', data.success);
|
|
|
- $scope.ships = data;
|
|
|
- $scope.tender.shipAddress = $scope.ships[0];
|
|
|
+ // 获取收货地址列表
|
|
|
+ ShipAddress.shipAddList({}, function(data) {
|
|
|
+ $scope.ships = data;
|
|
|
+ $scope.tender.shipAddress = $scope.ships[0];
|
|
|
+ });
|
|
|
}
|
|
|
if(data.error) {
|
|
|
toaster.pop('error', '提示', data.error);
|
|
|
@@ -9924,6 +9927,90 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // 搜索
|
|
|
+ $scope.search = function() {
|
|
|
+ if($scope.keyword) {
|
|
|
+ if($scope.searchType.brand) {
|
|
|
+ SessionService.set('brand', true);
|
|
|
+ SessionService.unset('component');
|
|
|
+ window.location.href = 'search?w=' + encodeURI(encodeURI($scope.keyword)) + '&type=brand';
|
|
|
+ }else if($scope.searchType.isCmp()){
|
|
|
+ SessionService.set('component', angular.toJson($scope.searchType));
|
|
|
+ SessionService.unset('brand');
|
|
|
+ window.location.href = 'search?w=' + encodeURI(encodeURI($scope.keyword)) + '&type=component';
|
|
|
+ }else {
|
|
|
+ SessionService.unset('component');
|
|
|
+ SessionService.unset('brand');
|
|
|
+ window.location.href = 'search?w=' + encodeURI(encodeURI($scope.keyword)) + '&type=all';
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 搜索框获得焦点,显示联想框
|
|
|
+ $scope.onFocus = function() {
|
|
|
+ $scope.associate = true;
|
|
|
+ $scope.selectIndex = -1;
|
|
|
+ if(!$scope.keyword) $scope.keyword = '';
|
|
|
+ };
|
|
|
+
|
|
|
+ // 搜索框失去焦点,关闭联想框
|
|
|
+ $scope.onBlur = function() {
|
|
|
+ $scope.associate = false;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 搜索框通过按键选取想要的联想词
|
|
|
+ $scope.onKeyup = function() {
|
|
|
+ if($scope.associates && $scope.associates.length) {
|
|
|
+ if(event.keyCode == 40) { //监听到按下键
|
|
|
+ $scope.selectIndex ++;
|
|
|
+ if($scope.selectIndex >= $scope.associates.length) $scope.selectIndex = 0;
|
|
|
+ $scope.keyword = $scope.associates[$scope.selectIndex];
|
|
|
+ } else if(event.keyCode == 38) { //监听到按上键
|
|
|
+ $scope.selectIndex --;
|
|
|
+ if($scope.selectIndex < 0) $scope.selectIndex = $scope.associates.length - 1;
|
|
|
+ $scope.keyword = $scope.keyword = $scope.associates[$scope.selectIndex];
|
|
|
+ } else if(event.keyCode == 13) { //确定键
|
|
|
+ $scope.search();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 输入框内容变化,获取新的联想词
|
|
|
+ $scope.onChange = function(prodCode) {
|
|
|
+ if (prodCode) {
|
|
|
+ var params = {
|
|
|
+ keyword: prodCode
|
|
|
+ };
|
|
|
+ $http.get('tender/similarKeywords', {
|
|
|
+ params : params
|
|
|
+ }).success(function(data){
|
|
|
+ $scope.associates = data;// 联想词数组
|
|
|
+ }).error(function(response) {
|
|
|
+
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $scope.associates = [];// 联想词数组
|
|
|
+ }
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ // 点击联想词
|
|
|
+ $scope.onAssociateClick = function(component) {
|
|
|
+ $scope.keyword = component;
|
|
|
+ $scope.search();
|
|
|
+ };
|
|
|
+
|
|
|
+ // 鼠标进入联想词框,不能关闭联想词框
|
|
|
+ $scope.onAssociateEnter = function() {
|
|
|
+ $scope.associateEnter = true;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 鼠标离开联想词框,可以关闭联想词框
|
|
|
+ $scope.onAssociateLeave = function() {
|
|
|
+ $scope.associateEnter = false;
|
|
|
+ };
|
|
|
+
|
|
|
$scope.condition = {dateZone: 1};
|
|
|
$scope.tenderProd = [];
|
|
|
var prod = {
|
|
|
@@ -10654,23 +10741,27 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
|
|
|
$scope.validEmNum = function (value) {
|
|
|
var regex = /^\+?[1-9][0-9]*$/;
|
|
|
- if (!regex.test(value) || value == 0) {
|
|
|
+ if (!regex.test(value) || value == 0 || value !== null) {
|
|
|
$scope.emNumYes = false;
|
|
|
toaster.pop('warning', '警告', '人数不合法,请重新填写');
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- $scope.validateProds = function(tenderProds) {
|
|
|
- $scope.canSave = true;
|
|
|
- angular.forEach(tenderProds, function (tenderProd) {
|
|
|
- var cycleRegex = /^\+?[1-9][0-9]*$/;
|
|
|
- var taxrateRegex = /^\+?[0-9][0-9]{0,1}$/;
|
|
|
- var priceRegex = /^(([0-9]+\.[0-9]{1,6})|([0-9]*[1-9][0-9]*\.[0-9]{1,6})|([0-9]*[1-9][0-9]*))$/; // 非零最多六位小数正实数
|
|
|
- // /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
- if (!cycleRegex.test(tenderProd.currentItem.cycle) || !taxrateRegex.test(tenderProd.currentItem.taxrate) || (!priceRegex.test(tenderProd.currentItem.price) && tenderProd.currentItem.price !== 0)) {
|
|
|
- $scope.canSave = false;
|
|
|
- }
|
|
|
- });
|
|
|
+ $scope.validateProds = function(tenderProd) {
|
|
|
+ // angular.forEach(tenderProds, function (tenderProd) {
|
|
|
+ var cycleRegex = /^\+?[1-9][0-9]*$/;
|
|
|
+ var taxrateRegex = /^\+?[0-9][0-9]{0,1}$/;
|
|
|
+ var priceRegex = /^(([0-9]+\.[0-9]{1,6})|([0-9]*[1-9][0-9]*\.[0-9]{1,6})|([0-9]*[1-9][0-9]*))$/; // 非零最多六位小数正实数
|
|
|
+ // /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
+ // 判断填写过的有为0或不符合正则式的,设置不能保存
|
|
|
+ console.log(tenderProd.currentItem.cycle);
|
|
|
+ if ((!cycleRegex.test(tenderProd.currentItem.cycle) && tenderProd.currentItem.cycle !== null) || (!taxrateRegex.test(tenderProd.currentItem.taxrate) && tenderProd.currentItem.taxrate !== null) || ((!priceRegex.test(tenderProd.currentItem.price) && tenderProd.currentItem.price !== 0) && tenderProd.currentItem.price !== null)) {
|
|
|
+ console.log("不能保存啦!!!");
|
|
|
+ $scope.canSave = false;
|
|
|
+ } else {
|
|
|
+ $scope.canSave = true;
|
|
|
+ }
|
|
|
+ // });
|
|
|
};
|
|
|
|
|
|
// 投标
|