|
|
@@ -1791,7 +1791,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
app.controller('TenderCtrl', ['$scope', 'SnapshotService', function ($scope, SnapshotService) {
|
|
|
// SnapshotService.getTender(250, function(data){
|
|
|
// $scope.tenders = data;
|
|
|
- // console.log(data);
|
|
|
// var newDate = new Date();
|
|
|
// newDate = newDate.setDate(newDate.getDate() - 3);
|
|
|
// angular.forEach($scope.tenders, function(tender) {
|
|
|
@@ -1825,12 +1824,18 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}]);
|
|
|
|
|
|
// 客户
|
|
|
- app.controller('CustomerCtrl', ['$scope', 'VendorService', 'BaseService', 'AuthenticationService', 'ngTableParams', '$modal', 'toaster', 'Vendor', 'AccountUser', function ($scope, VendorService, BaseService, AuthenticationService, ngTableParams, $modal, toaster, Vendor, AccountUser) {
|
|
|
+ app.controller('CustomerCtrl', ['$scope', 'VendorService', 'BaseService', 'AuthenticationService', 'ngTableParams', '$modal', 'toaster', 'Vendor', 'AccountUser', 'CurrentRole', function ($scope, VendorService, BaseService, AuthenticationService, ngTableParams, $modal, toaster, Vendor, AccountUser, CurrentRole) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
$scope.userInfoResult = true;
|
|
|
AuthenticationService.getAuthentication().success(function (data) {
|
|
|
$scope.loading = false;
|
|
|
$scope.thisUser = data;
|
|
|
+ });
|
|
|
+ // 获取当前用户分配客户的操作权限
|
|
|
+ CurrentRole.roles({}, function (data) {
|
|
|
+ $scope.enabled = data.count > 0 ? true : false ;
|
|
|
+ }, function (response) {
|
|
|
+
|
|
|
});
|
|
|
var getCustInfos = function (custuu) {
|
|
|
if (custuu) {
|
|
|
@@ -1874,8 +1879,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
AccountUser.getEnTransfer ({custUU: customer.myEnterprise.uu}, function(data) {
|
|
|
customer.enTransfer = data.result;
|
|
|
//是管理员,或者被转移了权限时
|
|
|
- console.log(customer.enTransfer);
|
|
|
- if ($scope.thisUser.sys || customer.enTransfer) {
|
|
|
+ if ($scope.enabled || customer.enTransfer) {
|
|
|
var modalInstance = $modal.open({
|
|
|
animation: true,
|
|
|
templateUrl: 'static/tpl/index/account/add_userInfo.html',
|
|
|
@@ -2312,8 +2316,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
});
|
|
|
$scope.transfer = transfer;
|
|
|
- console.log($scope.havedone);
|
|
|
- console.log($scope.transfer);
|
|
|
$scope.isChanged = !angular.equals($scope.havedone, $scope.transfer);
|
|
|
};
|
|
|
$scope.isChanged = false;
|
|
|
@@ -2387,7 +2389,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('error', '保存失败', "您未选择权限转移对象");
|
|
|
} else {
|
|
|
$scope.loading = true;
|
|
|
- console.log($scope.target);
|
|
|
AccountUser.transferMyDistribute({custUU: customer.myEnterprise.uu, userUU: $scope.target.userUU}, {} ,function (data) {
|
|
|
$scope.loading = false;
|
|
|
toaster.pop('success', '提示', '保存成功');
|
|
|
@@ -2932,7 +2933,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
$scope.loading = false;
|
|
|
if (page) {
|
|
|
- console.log(page);
|
|
|
//获取每个明细单最新回复数
|
|
|
angular.forEach(page.content, function(order){
|
|
|
angular.forEach(order.orderItems, function(item){
|
|
|
@@ -3444,7 +3444,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}]);
|
|
|
|
|
|
//客户采购询价
|
|
|
- app.controller('SaleInquiryCtrl', ['$scope', '$filter', 'PurcInquiry', 'ngTableParams', 'toaster', 'BaseService', 'PurcInquiryInfo', '$upload', '$rootScope', 'token', function ($scope, $filter, PurcInquiry, ngTableParams, toaster, BaseService, PurcInquiryInfo, $upload, $rootScope, token) {
|
|
|
+ app.controller('SaleInquiryCtrl', ['$scope', '$filter', 'PurcInquiry', 'ngTableParams', 'toaster', 'BaseService', 'PurcInquiryInfo', '$upload', '$rootScope', 'token', '$timeout', function ($scope, $filter, PurcInquiry, ngTableParams, toaster, BaseService, PurcInquiryInfo, $upload, $rootScope, token, $timeout) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
if ($rootScope.active) {
|
|
|
$scope.active = $rootScope.active;
|
|
|
@@ -3653,7 +3653,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
if ((i > 0 ? r.lapQty : 1) || r.price) {
|
|
|
replies.push(r);
|
|
|
}
|
|
|
- if (i > 0 && r.lapQty <= item.replies[i - 1].lapQty || r.lapQty == null) {
|
|
|
+ // 直接比较是字符串比较,需要先转换再比较 2017年9月7日 15:05:51
|
|
|
+ if (i > 0 && parseInt(r.lapQty) <= parseInt(item.replies[i - 1].lapQty) || r.lapQty == null) {
|
|
|
valid = false;
|
|
|
validLapQty = r.lapQty;
|
|
|
}
|
|
|
@@ -3668,33 +3669,52 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
$scope.loading = false;
|
|
|
} else {
|
|
|
- var file = item.myFiles, file = file && file.length > 0 ? file[0] : null;
|
|
|
- $upload.upload({
|
|
|
- url: 'sale/inquiry/addAttach',
|
|
|
- file: file,
|
|
|
- method: 'POST',
|
|
|
- data: {
|
|
|
- item: item
|
|
|
- }
|
|
|
- }).success(function (data) {
|
|
|
- if (data.item) {
|
|
|
- item = data.item;
|
|
|
- }
|
|
|
- });
|
|
|
if (withSteps) { // 保存并报价
|
|
|
PurcInquiry.reply({itemId: item.id, token: $scope.token}, item, function () {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('info', '提示', '报价成功');
|
|
|
- $scope.tableParams.reload();
|
|
|
+ var file = item.myFiles, file = file && file.length > 0 ? file[0] : null;
|
|
|
+ $upload.upload({
|
|
|
+ url: 'sale/inquiry/addAttach',
|
|
|
+ file: file,
|
|
|
+ method: 'POST',
|
|
|
+ data: {
|
|
|
+ item: item
|
|
|
+ }
|
|
|
+ }).success(function (data) {
|
|
|
+ if (data.item) {
|
|
|
+ item = data.item;
|
|
|
+ }
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('info', '提示', '报价成功');
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ }).error(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '附件上传失败');
|
|
|
+ });
|
|
|
}, function (response) {
|
|
|
$scope.loading = false;
|
|
|
toaster.pop('error', '询价失效', response.data);
|
|
|
});
|
|
|
} else { // 保存
|
|
|
PurcInquiry.saveItem({itemId: item.id, token: $scope.token}, item, function () {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('info', '提示', '保存成功');
|
|
|
- $scope.tableParams.reload();
|
|
|
+ var file = item.myFiles, file = file && file.length > 0 ? file[0] : null;
|
|
|
+ $upload.upload({
|
|
|
+ url: 'sale/inquiry/addAttach',
|
|
|
+ file: file,
|
|
|
+ method: 'POST',
|
|
|
+ data: {
|
|
|
+ item: item
|
|
|
+ }
|
|
|
+ }).success(function (data) {
|
|
|
+ if (data.item) {
|
|
|
+ item = data.item;
|
|
|
+ }
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('info', '提示', '保存成功');
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ }).error(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '附件上传失败');
|
|
|
+ });
|
|
|
}, function (response) {
|
|
|
$scope.loading = false;
|
|
|
toaster.pop('error', '保存失败', response.data);
|
|
|
@@ -3772,7 +3792,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
attach.type = attach.name.substr(attach.name.lastIndexOf('.') + 1);
|
|
|
});
|
|
|
$scope.inquiry = inquiry;
|
|
|
- console.log($scope.inquiry);
|
|
|
});
|
|
|
};
|
|
|
loadData();
|
|
|
@@ -4052,7 +4071,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
|
|
|
$scope.removeChecked = function () {
|
|
|
- console.log($scope.vendors);
|
|
|
if ($scope.vendors.length > 0) {
|
|
|
$scope.vendors = [];
|
|
|
$rootScope.tenderVendor = '';
|
|
|
@@ -4219,7 +4237,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
modalInstance.result.then(function (data) {
|
|
|
angular.forEach(data, function (prod) {
|
|
|
- console.log(prod);
|
|
|
$scope.inquiry.inquiryItems.push(prod);
|
|
|
for (var i = 0; i < $scope.inquiry.inquiryItems.length; i++) {
|
|
|
if ($scope.inquiry.inquiryItems[i].prodCode == null) { // 如果没有填写就删除这行数据
|
|
|
@@ -4874,7 +4891,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// };
|
|
|
|
|
|
$scope.nowdate = new Date().getTime() - 24 * 3600 * 1000;
|
|
|
- console.log($scope.nowdate);
|
|
|
var getOpenState = function (active) {
|
|
|
var fn = 'getOpenAll';
|
|
|
switch (active) {
|
|
|
@@ -4951,7 +4967,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.inquiryItem = data.inquiryItem;
|
|
|
if (data.id) {
|
|
|
$scope.id = data.id;
|
|
|
- console.log($scope.id);
|
|
|
$scope.currentHasBid = true;
|
|
|
}
|
|
|
}, function (response) {
|
|
|
@@ -5785,7 +5800,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
//是否不能被点击
|
|
|
$scope.isDisabled = function () {
|
|
|
- console.log($scope.item);
|
|
|
return $scope.item.quotation.status == 101 && $scope.item.agreed == null;
|
|
|
}
|
|
|
|
|
|
@@ -8303,7 +8317,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
var loadData = function () {
|
|
|
FaApBillOut.get({id:$stateParams.id},function (data) {
|
|
|
$scope.data = data;
|
|
|
- console.log(data);
|
|
|
if($scope.data.status){
|
|
|
|
|
|
}else{
|
|
|
@@ -8474,7 +8487,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
});
|
|
|
$scope.data = data;
|
|
|
- console.log($scope.data);
|
|
|
$scope.checkboxes.checked = true;
|
|
|
$scope.getTotalMoney();
|
|
|
} else {
|
|
|
@@ -8502,7 +8514,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.checkAll = function () {
|
|
|
$scope.totalMoney = 0;
|
|
|
$scope.filteredData = $filter('filter')($scope.data, $scope.condition.prodTitle || $scope.condition.uuorname || $scope.condition.venduuorname || $scope.condition.prodSpec || $scope.condition.factory);
|
|
|
- console.log($scope.filteredData );
|
|
|
var uuorname = $scope.suuorname;
|
|
|
var venduuorname = $scope.venduuorname;
|
|
|
var dateFrom = $scope.condition.dateFrom;
|
|
|
@@ -8610,7 +8621,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
//本次开票新的开票数
|
|
|
//$scope.thisBilledQty = 0;
|
|
|
if(checkItem.$selected == true) {
|
|
|
- console.log(checkItem);
|
|
|
$scope.apBillOut.custName = checkItem.apCheck.custName;
|
|
|
$scope.apBillOut.enUu = checkItem.apCheck.enUu;
|
|
|
|
|
|
@@ -8688,7 +8698,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
|
|
|
//应收开票单明细行数据
|
|
|
- console.log(checkItem);
|
|
|
//$scope.item.orderCode = check.orderCode;
|
|
|
//$scope.item.orderClass = check.piClass;
|
|
|
//$scope.item.orderDetno = check.orderDetno;
|
|
|
@@ -8859,7 +8868,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
var loadData = function () {
|
|
|
FaApBill.get({id: $stateParams.id}, function (data) {
|
|
|
$scope.bill = data;
|
|
|
- console.log(data);
|
|
|
$scope.loading = false;
|
|
|
});
|
|
|
};
|
|
|
@@ -10077,7 +10085,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
}]);
|
|
|
|
|
|
- app.controller('UserCtrl', ['$scope', '$filter', 'AuthenticationService', 'AccountUser', 'BaseService', 'ngTableParams', 'toaster', '$modal', '$http', 'ngAlert', 'AccountEnterprise', function ($scope, $filter, AuthenticationService, AccountUser, BaseService, ngTableParams, toaster, $modal, $http, ngAlert, AccountEnterprise) {
|
|
|
+ app.controller('UserCtrl', ['$scope', '$filter', 'AuthenticationService', 'AccountUser', 'BaseService', 'ngTableParams', 'toaster', '$modal', '$http', 'ngAlert', 'AccountEnterprise', 'CurrentRole', function ($scope, $filter, AuthenticationService, AccountUser, BaseService, ngTableParams, toaster, $modal, $http, ngAlert, AccountEnterprise, CurrentRole) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
$scope.editing = false;
|
|
|
$scope.loading = true;
|
|
|
@@ -10094,6 +10102,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.user = data;
|
|
|
});
|
|
|
var users = [];
|
|
|
+
|
|
|
+ var getMangagerInfo = function() {
|
|
|
+ CurrentRole.isManager({}, function(data) {
|
|
|
+ $scope.isManager = data.isManager;
|
|
|
+ });
|
|
|
+ };
|
|
|
+ getMangagerInfo();
|
|
|
+
|
|
|
$scope.tableParams = new ngTableParams({
|
|
|
page: 1,
|
|
|
count: 20,
|
|
|
@@ -10470,7 +10486,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
setBtnTimeDown($scope.btnTimes);
|
|
|
$scope.msgInfoError = false;
|
|
|
},function(response){
|
|
|
- console.log(response);
|
|
|
$scope.loading = false;
|
|
|
$scope.msgInfoError = false;
|
|
|
$scope.sendCheckMsg = false;
|
|
|
@@ -10669,7 +10684,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
if (save) {
|
|
|
if (user.userUU) {
|
|
|
user.roles = $scope.checked;
|
|
|
- console.log(user.roles);
|
|
|
AccountUser.update({}, user, function () {
|
|
|
toaster.pop('success', '提示', '保存成功');
|
|
|
$modalInstance.close(true);
|
|
|
@@ -13467,18 +13481,22 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
app.controller('PurcUploadByBatchCtrl', ['$scope', 'toaster', '$upload', '$modalInstance', function ($scope, toaster, $upload, $modalInstance) {
|
|
|
// 通过excel批量上传物料
|
|
|
$scope.result = null;
|
|
|
+ $scope.loading = false;
|
|
|
$scope.upload = function () {
|
|
|
+ $scope.loading = true;
|
|
|
var file = $scope.myFiles[0];
|
|
|
$upload.upload({
|
|
|
url: 'purchase/release/excel',
|
|
|
file: file,
|
|
|
method: 'POST'
|
|
|
}).success(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
$scope.result = data;
|
|
|
$scope.success = $scope.result.success;
|
|
|
$scope.total = $scope.result.total;
|
|
|
$scope.alters = $scope.result.alters;
|
|
|
}).error(function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
toaster.pop('error', response.data || response);
|
|
|
});
|
|
|
};
|
|
|
@@ -13492,6 +13510,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$modalInstance.close($scope.result.products);
|
|
|
}
|
|
|
|
|
|
+ // 点击确定时增加加载标志
|
|
|
+ $scope.addClass = function() {
|
|
|
+ $scope.loading = true;
|
|
|
+ }
|
|
|
+
|
|
|
$scope.cancel = function () {
|
|
|
$modalInstance.dismiss();
|
|
|
}
|
|
|
@@ -15837,7 +15860,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('info', '提示', '交货时间未选择');
|
|
|
} else {
|
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function (orderitem, index) {
|
|
|
- console.log(orderitem);
|
|
|
if (orderitem.prodname == null) {
|
|
|
toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行产品名称未填写');
|
|
|
} else if (orderitem.prodcode == null) {
|
|
|
@@ -16301,7 +16323,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('info', '提示', '交货时间未选择');
|
|
|
} else {
|
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function (orderitem, index) {
|
|
|
- console.log(orderitem);
|
|
|
if (orderitem.prodname == null) {
|
|
|
toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行产品名称未填写');
|
|
|
} else if (orderitem.prodcode == null) {
|
|
|
@@ -16845,7 +16866,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// $scope.onAssociateKindClick = function(kind, submit) {
|
|
|
// KindAPI.getParents({childId : kind.id}, {}, function(data) {
|
|
|
// $scope.actives = data;
|
|
|
- // console.log(data);
|
|
|
// var size = data.length;
|
|
|
// if (size > 0) {
|
|
|
// submit.gradeOneKiName = $scope.actives[0].nameCn;
|
|
|
@@ -16861,7 +16881,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
- // console.log(submit);
|
|
|
// })
|
|
|
// };
|
|
|
|
|
|
@@ -18103,20 +18122,12 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
*/
|
|
|
app.controller('SaleVendorTenderDetailCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', function ($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope) {
|
|
|
$scope.loading = true;
|
|
|
- PurcTender.getOne({id: $stateParams.id}, function (data) {
|
|
|
- $scope.bid = data;
|
|
|
- var vendUU = Number($stateParams.vendUU);
|
|
|
- angular.forEach(data.purchaseTenderProds, function (tenderProd) {
|
|
|
- angular.forEach(tenderProd.saleTenderItems, function (saleTenderItem) {
|
|
|
- if (saleTenderItem.saleTender.vendUU === vendUU) {// 与传出的参数venUU相等,即为查看企业对应的明细
|
|
|
- tenderProd.currentItem = saleTenderItem;
|
|
|
- $scope.saleTender = saleTenderItem.saleTender;
|
|
|
- $scope.currentEnBaseInfo = saleTenderItem.saleTender.enterpriseBaseInfo;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ PurcTender.getVendorSaleTenderDetail({tenderId: $stateParams.id, vendUU:$stateParams.vendUU}, function (data) {
|
|
|
+ $scope.saleTender = data.saleTender;
|
|
|
+ $scope.tender = data.tender;
|
|
|
$scope.loading = false;
|
|
|
}, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
toaster.pop('error', '数据加载失败', response.data);
|
|
|
});
|
|
|
|
|
|
@@ -18130,47 +18141,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
if (!$scope.attaches) {
|
|
|
$scope.attaches = []; // 存放上传了的附件
|
|
|
}
|
|
|
- $scope.loading = true;
|
|
|
- // var staticItem = null;
|
|
|
- // $scope.loading = true;
|
|
|
-
|
|
|
- // PurcTender.getItem({id: $stateParams.id}, function(data){
|
|
|
- // $scope.item = data; // 用于投标
|
|
|
- // if ($scope.item.enterpriseBaseInfo != null) {
|
|
|
- // $scope.itemStatusTodo = $scope.item.enterpriseBaseInfo.uu + "待投标";
|
|
|
- // }
|
|
|
- // staticItem = angular.copy(data);
|
|
|
- // $scope.loading = false;
|
|
|
- // }, function(response){
|
|
|
- // $scope.loading = false;
|
|
|
- // toaster.pop('error', '数据加载失败', response.data);
|
|
|
- // });
|
|
|
-
|
|
|
- var sleep = function (d) {
|
|
|
- for (var t = Date.now(); Date.now() - t <= d;);
|
|
|
- };
|
|
|
-
|
|
|
AccountEnterprise.get({}, function (data) {
|
|
|
$scope.currentEn = data;
|
|
|
});
|
|
|
|
|
|
- PurcTender.getOne({id: $stateParams.id}, function (data) {
|
|
|
- $scope.bid = data;
|
|
|
- angular.forEach(data.purchaseTenderProds, function (tenderProd) {
|
|
|
- angular.forEach(tenderProd.saleTenderItems, function (saleTenderItem) {
|
|
|
- if (!$scope.currentEn) {
|
|
|
- AccountEnterprise.get({}, function (data) {
|
|
|
- $scope.currentEn = data;
|
|
|
- });
|
|
|
- }
|
|
|
- if (saleTenderItem.saleTender.vendUU === $scope.currentEn.uu) {
|
|
|
- tenderProd.currentItem = saleTenderItem;
|
|
|
- $scope.saleTender = saleTenderItem.saleTender;
|
|
|
- $scope.attaches = saleTenderItem.saleTender.bidAttaches;
|
|
|
- $scope.currentEnBaseInfo = saleTenderItem.saleTender.enterpriseBaseInfo;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ $scope.loading = true;
|
|
|
+ PurcTender.getSaleTenderDetail({tenderId: $stateParams.id}, function (data) {
|
|
|
+ $scope.saleTender = data.saleTender;
|
|
|
+ $scope.tender = data.tender;
|
|
|
$scope.loading = false;
|
|
|
}, function (response) {
|
|
|
$scope.loading = false;
|
|
|
@@ -18190,9 +18168,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
$scope.removeAttach = function (attachId, index) {
|
|
|
$scope.attaches.splice(index, 1);
|
|
|
- // PurcTender.removeAttach({attachId : id}, {}, function() {
|
|
|
- //
|
|
|
- // });
|
|
|
};
|
|
|
|
|
|
var taxrateYes = false;
|
|
|
@@ -18200,37 +18175,33 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
var priceYes = false;
|
|
|
$scope.canSave = false;
|
|
|
$scope.validateThis = function (value, type) {
|
|
|
- switch (type) {
|
|
|
- case 'taxrate':
|
|
|
- var regex = /^\+?[0-9][0-9]{0,1}$/;
|
|
|
- if (regex.test(value)) {
|
|
|
- taxrateYes = true;
|
|
|
- } else {
|
|
|
- if (value) {
|
|
|
+ if ("" != value) {
|
|
|
+ switch (type) {
|
|
|
+ case 'taxrate':
|
|
|
+ var regex = /^\+?[0-9][0-9]{0,1}$/;
|
|
|
+ if (regex.test(value)) {
|
|
|
+ taxrateYes = true;
|
|
|
+ } else {
|
|
|
toaster.pop('warning', '警告', '税率不合法,请重新填写');
|
|
|
}
|
|
|
- }
|
|
|
- break;
|
|
|
- case 'cycle':
|
|
|
- regex = /^\+?[1-9][0-9]*$/;
|
|
|
- if (regex.test(value)) {
|
|
|
- cycleYes = true;
|
|
|
- } else {
|
|
|
- if (value) {
|
|
|
+ break;
|
|
|
+ case 'cycle':
|
|
|
+ regex = /^\+?[1-9][0-9]*$/;
|
|
|
+ if (regex.test(value)) {
|
|
|
+ cycleYes = true;
|
|
|
+ } else {
|
|
|
toaster.pop('warning', '警告', '周期不合法,请重新填写');
|
|
|
}
|
|
|
- }
|
|
|
- break;
|
|
|
- case 'price':
|
|
|
- regex = /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
- if (regex.test(value) && value !== 0) {
|
|
|
- priceYes = true;
|
|
|
- } else {
|
|
|
- if (value) {
|
|
|
+ break;
|
|
|
+ case 'price':
|
|
|
+ regex = /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
+ if (regex.test(value) && value !== 0) {
|
|
|
+ priceYes = true;
|
|
|
+ } else {
|
|
|
toaster.pop('warning', '警告', '请确认单价是否填写正确');
|
|
|
}
|
|
|
- }
|
|
|
- break;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -18244,55 +18215,52 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- $scope.validateProds = function (tenderProd) {
|
|
|
+ $scope.validateProds = function (saleTender) {
|
|
|
$scope.canSave = true;
|
|
|
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]*))$/; // 非零最多六位小数正实数
|
|
|
- if ($scope.bid.ifAll == 1) { // 全包时需要所有信息都填写并合法才可以投标
|
|
|
+ if ($scope.tender.ifAll == 1) { // 全包时需要所有信息都填写并合法才可以投标
|
|
|
// 全包全部需要填写,且需要符合正则式
|
|
|
- angular.forEach($scope.bid.purchaseTenderProds, function(prod) {
|
|
|
- if ((!prod.currentItem.cycle || !prod.currentItem.price) || (!cycleRegex.test(prod.currentItem.cycle) || !priceRegex.test(prod.currentItem.price))) {
|
|
|
+ angular.forEach(saleTender.saleTenderItems, function(item) {
|
|
|
+ if ((!item.cycle || !item.price) || (!cycleRegex.test(item.cycle) || !priceRegex.test(item.price))) {
|
|
|
$scope.canSave = false;
|
|
|
}
|
|
|
});
|
|
|
- if (!$scope.saleTender.cycle || !$scope.saleTender.taxrate || !cycleRegex.test($scope.saleTender.cycle) || !taxrateRegex.test($scope.saleTender.taxrate)) {
|
|
|
+ if (!saleTender.cycle || !saleTender.taxrate || !cycleRegex.test(saleTender.cycle) || !taxrateRegex.test(saleTender.taxrate)) {
|
|
|
$scope.canSave = false;
|
|
|
}
|
|
|
- } else {
|
|
|
- if (tenderProd.currentItem.cycle || tenderProd.currentItem.taxrate || tenderProd.currentItem.price) {
|
|
|
- // /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
- // 判断填写过的有为0或不符合正则式的,设置不能保存
|
|
|
- if (!cycleRegex.test(tenderProd.currentItem.cycle) || !taxrateRegex.test(tenderProd.currentItem.taxrate) || !priceRegex.test(tenderProd.currentItem.price)) {
|
|
|
- $scope.canSave = false;
|
|
|
- } else {
|
|
|
- $scope.canSave = true;
|
|
|
+ } else { // 非全包模式
|
|
|
+ angular.forEach(saleTender.saleTenderItems, function(item) {
|
|
|
+ if (item.cycle || item.taxrate || item.price) {
|
|
|
+ // /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
+ // 判断填写过的有为0或不符合正则式的,设置不能保存
|
|
|
+ if (!cycleRegex.test(item.cycle) || !taxrateRegex.test(item.taxrate) || !priceRegex.test(item.price)) {
|
|
|
+ $scope.canSave = false;
|
|
|
+ } else {
|
|
|
+ $scope.canSave = true;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// 投标
|
|
|
- $scope.bidIt = function (tender, currentEnBaseInfo, saleTender) {
|
|
|
+ $scope.bidIt = function (saleTender) {
|
|
|
$scope.loading = true;
|
|
|
- if (currentEnBaseInfo.enEstablishDate instanceof Date) {
|
|
|
- currentEnBaseInfo.enEstablishDate = currentEnBaseInfo.enEstablishDate.getTime();
|
|
|
+ if (saleTender.enterpriseBaseInfo.enEstablishDate instanceof Date) {
|
|
|
+ saleTender.enterpriseBaseInfo.enEstablishDate = saleTender.enterpriseBaseInfo.enEstablishDate.getTime();
|
|
|
}
|
|
|
- var saleTenderItems = [];
|
|
|
- angular.forEach(tender.purchaseTenderProds, function (tenderProd) {
|
|
|
- if (tenderProd.currentItem) {
|
|
|
- if ("" !== tenderProd.currentItem.price && "" !== tenderProd.currentItem.taxrate && "" !== tenderProd.currentItem.cycle) {
|
|
|
- tenderProd.currentItem.saleTender = {};
|
|
|
- saleTenderItems.push(tenderProd.currentItem);
|
|
|
- }
|
|
|
+ saleTender.bidAttaches.push.apply(saleTender.bidAttaches, $scope.attaches);
|
|
|
+ angular.forEach(saleTender.saleTenderItems, function (item) {
|
|
|
+ item.tenderProd = {};
|
|
|
+ if ("" == item.price && "" == item.taxrate && "" == item.cycle) {
|
|
|
+ item.price = 0;
|
|
|
+ item.cycle = 0;
|
|
|
+ item.taxrate = 0;
|
|
|
}
|
|
|
});
|
|
|
- PurcTender.reply({
|
|
|
- tenderItems: saleTenderItems,
|
|
|
- enBaseInfo: currentEnBaseInfo,
|
|
|
- attaches: $scope.attaches,
|
|
|
- saleTender: saleTender
|
|
|
- }, {}, function (data) {
|
|
|
+ PurcTender.reply({}, saleTender, function (data) {
|
|
|
$scope.loading = false;
|
|
|
toaster.pop('info', '成功', '投标成功');
|
|
|
// $window.location.reload();
|
|
|
@@ -18356,7 +18324,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
});
|
|
|
// $rootScope.tenderVendor = $scope.tenderProd.enterpriseBaseInfo;
|
|
|
- // console.log($scope.tenderProd.enterpriseBaseInfo);
|
|
|
$scope.loading = false;
|
|
|
|
|
|
$scope.attaches = $scope.tender.tenderAttaches;
|
|
|
@@ -18464,7 +18431,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// 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 (tenderProd.currentItem.cycle !== null && (!cycleRegex.test(tenderProd.currentItem.cycle)) || (tenderProd.currentItem.taxrate !== null && !taxrateRegex.test(tenderProd.currentItem.taxrate)) || (tenderProd.currentItem.price !==null && (!priceRegex.test(tenderProd.currentItem.price) && tenderProd.currentItem.price !== 0))) {
|
|
|
// $scope.canSave = false;
|
|
|
// } else {
|
|
|
@@ -18935,7 +18901,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
code: 'XJ' + $filter('date')(new Date(), 'yyMMddsss'),
|
|
|
showdate: $filter('date')(new Date, 'yyyy-MM-dd'),
|
|
|
priceType: '采购',
|
|
|
- isOpen: 1,
|
|
|
+ isOpen: 0,
|
|
|
invoice: 0,
|
|
|
ifTax: 1,
|
|
|
currency: 'RMB'
|
|
|
@@ -19111,7 +19077,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
modalInstance.result.then(function (data) {
|
|
|
angular.forEach(data, function (prod) {
|
|
|
- console.log(prod);
|
|
|
$scope.inquiry.inquiryItems.push(prod);
|
|
|
for (var i = 0; i < $scope.inquiry.inquiryItems.length; i++) {
|
|
|
if ($scope.inquiry.inquiryItems[i].prodCode == null) { // 如果没有填写就删除这行数据
|
|
|
@@ -20359,7 +20324,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
//提交
|
|
|
$scope.submit = function (prodInfo) {
|
|
|
$scope.prodInfo.isPurchase = 1;
|
|
|
- console.log(prodInfo);
|
|
|
var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
|
|
|
$upload.upload({
|
|
|
url: 'product/baseInfo/addNewProduct',
|