|
@@ -677,6 +677,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
$scope.showMessage = function() {
|
|
$scope.showMessage = function() {
|
|
|
|
|
+ $rootScope.isOpen = true;
|
|
|
var $modalInstance = $modal.open({
|
|
var $modalInstance = $modal.open({
|
|
|
templateUrl: 'static/tpl/index/home/pagingRelease.html',
|
|
templateUrl: 'static/tpl/index/home/pagingRelease.html',
|
|
|
controller: 'PagingReleaseCtrl'
|
|
controller: 'PagingReleaseCtrl'
|
|
@@ -3143,6 +3144,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
|
|
|
|
|
// 查找供应商
|
|
// 查找供应商
|
|
|
app.controller('DbfindVendorCtrl', ['$scope', 'Vendor', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance','$rootScope', function($scope, Vendor, BaseService, ngTableParams, toaster, $modalInstance, $rootScope){
|
|
app.controller('DbfindVendorCtrl', ['$scope', 'Vendor', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance','$rootScope', function($scope, Vendor, BaseService, ngTableParams, toaster, $modalInstance, $rootScope){
|
|
|
|
|
+
|
|
|
|
|
+ // 搜索框回车
|
|
|
|
|
+ $scope.onSearch = function(keyword) {
|
|
|
|
|
+ $scope.keyword = keyword;
|
|
|
|
|
+ $scope.tableParams.page(1);
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
$scope.tableParams = new ngTableParams({
|
|
$scope.tableParams = new ngTableParams({
|
|
|
page : 1,
|
|
page : 1,
|
|
|
count : 25
|
|
count : 25
|
|
@@ -3151,7 +3160,9 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
counts: [10, 25, 50, 100],
|
|
counts: [10, 25, 50, 100],
|
|
|
getData : function($defer, params) {
|
|
getData : function($defer, params) {
|
|
|
$scope.loading = true;
|
|
$scope.loading = true;
|
|
|
- Vendor.getVendor(BaseService.parseParams(params.url()), function(page){
|
|
|
|
|
|
|
+ var pageParams = params.url();
|
|
|
|
|
+ pageParams.keyword = $scope.keyword;
|
|
|
|
|
+ Vendor.getVendor.call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
if(page) {
|
|
|
params.total(page.totalElements);
|
|
params.total(page.totalElements);
|
|
@@ -3196,7 +3207,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.checkOne = function(vendor) {
|
|
$scope.checkOne = function(vendor) {
|
|
|
vendor.checked = true;
|
|
vendor.checked = true;
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
$scope.close = function(){
|
|
$scope.close = function(){
|
|
|
var vendors = [];
|
|
var vendors = [];
|
|
@@ -3206,7 +3217,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$modalInstance.close(vendors);
|
|
$modalInstance.close(vendors);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
// 发货提醒
|
|
// 发货提醒
|
|
@@ -9742,11 +9754,38 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
/**
|
|
/**
|
|
|
* 新增招标单
|
|
* 新增招标单
|
|
|
*/
|
|
*/
|
|
|
- app.controller('PurcNewTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', '$upload', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, $upload) {
|
|
|
|
|
|
|
+ app.controller('PurcNewTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', '$upload', 'ShipAddress', '$http', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, $upload, ShipAddress, $http) {
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.loading = false;
|
|
$scope.loading = false;
|
|
|
|
|
|
|
|
|
|
+ // 获取收货地址列表
|
|
|
|
|
+ ShipAddress.shipAddList({}, function(data) {
|
|
|
|
|
+ $scope.ships = data;
|
|
|
|
|
+ $scope.tender.shipAddress = $scope.ships[0];
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 获取地址信息
|
|
|
|
|
+ $http.get('resources/citydata/city.json', {"Accept": "application/json;charset=utf-8", "Accept-Charset":"charset=utf-8"
|
|
|
|
|
+ }).then(function(response) {
|
|
|
|
|
+ $scope.provinces = response.data;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 新增收货地址保存
|
|
|
|
|
+ $scope.saveShipAddress = function(ship) {
|
|
|
|
|
+ ship.address = ship.province + ship.city + ship.district;
|
|
|
|
|
+ ShipAddress.saveAddress( {}, ship, function(data) {
|
|
|
|
|
+ if(data.success) {
|
|
|
|
|
+ toaster.pop('success', '提示', data.success);
|
|
|
|
|
+ $scope.ships = data;
|
|
|
|
|
+ $scope.tender.shipAddress = $scope.ships[0];
|
|
|
|
|
+ }
|
|
|
|
|
+ if(data.error) {
|
|
|
|
|
+ toaster.pop('error', '提示', data.error);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$scope.condition = {dateZone: 1};
|
|
$scope.condition = {dateZone: 1};
|
|
|
$scope.tenderProd = [];
|
|
$scope.tenderProd = [];
|
|
|
var prod = {
|
|
var prod = {
|
|
@@ -9787,12 +9826,40 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
$scope.tenderProd.splice(index, 1);
|
|
$scope.tenderProd.splice(index, 1);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // 批量导入
|
|
|
|
|
+ $scope.uplodaByBatch = function() {
|
|
|
|
|
+ var modalInstance = $modal.open({
|
|
|
|
|
+ templateUrl: 'static/tpl/index/purc/modal/uplodaByBatch.html',
|
|
|
|
|
+ controller: 'PurcTenderUploadCtrl',
|
|
|
|
|
+ size: 'lg',
|
|
|
|
|
+ resolve: {
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ modalInstance.result.then(function(data) {
|
|
|
|
|
+ // 获取上传的产品明细,前台展示
|
|
|
|
|
+ angular.forEach(data, function(data) {
|
|
|
|
|
+ console.log(data);
|
|
|
|
|
+ $scope.tenderProd.push(data);
|
|
|
|
|
+ for(var i = 0; i < $scope.tenderProd.length; i++) {
|
|
|
|
|
+ if($scope.tenderProd[i].prodname == null) { // 如果没有填写就删除这行数据
|
|
|
|
|
+ $scope.tenderProd.splice(i, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }, function(){
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 已存在id的为查看招标单(用于在录入的招标单的发布和删除)
|
|
// 已存在id的为查看招标单(用于在录入的招标单的发布和删除)
|
|
|
if( ! angular.isUndefined($stateParams.id)) {
|
|
if( ! angular.isUndefined($stateParams.id)) {
|
|
|
$scope.loading = true;
|
|
$scope.loading = true;
|
|
|
PurcTender.getOne({id: $stateParams.id}, function(data){
|
|
PurcTender.getOne({id: $stateParams.id}, function(data){
|
|
|
data.$editing = false;
|
|
data.$editing = false;
|
|
|
$scope.tender = data;
|
|
$scope.tender = data;
|
|
|
|
|
+ $scope.firstProd = data.purchaseTenderProds[0];
|
|
|
console.log($scope.tender);
|
|
console.log($scope.tender);
|
|
|
$scope.loading = false;
|
|
$scope.loading = false;
|
|
|
}, function(response){
|
|
}, function(response){
|
|
@@ -9823,7 +9890,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
// }
|
|
// }
|
|
|
// };
|
|
// };
|
|
|
|
|
|
|
|
- // 查找客户
|
|
|
|
|
|
|
+ // 查找供应商
|
|
|
$scope.dbfindVendor = function(){
|
|
$scope.dbfindVendor = function(){
|
|
|
var modalInstance = $modal.open({
|
|
var modalInstance = $modal.open({
|
|
|
templateUrl: 'static/tpl/index/purc/tender_vendor.html',
|
|
templateUrl: 'static/tpl/index/purc/tender_vendor.html',
|
|
@@ -9970,8 +10037,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 删除(在录入状态)
|
|
// 删除(在录入状态)
|
|
|
- // TODO
|
|
|
|
|
- $scope.deleted = function(tender) {
|
|
|
|
|
|
|
+ $scope.deleteThis = function(tender) {
|
|
|
PurcTender.deleteOne({}, tender, function() {
|
|
PurcTender.deleteOne({}, tender, function() {
|
|
|
toaster.pop('info', '提示', '删除成功');
|
|
toaster.pop('info', '提示', '删除成功');
|
|
|
window.location.hash = '#/purc/tender';
|
|
window.location.hash = '#/purc/tender';
|
|
@@ -9980,8 +10046,8 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
|
|
|
|
|
// 发布(在录入状态)
|
|
// 发布(在录入状态)
|
|
|
$scope.publishSaved = function(tender) {
|
|
$scope.publishSaved = function(tender) {
|
|
|
- var now = new Date().getTime();
|
|
|
|
|
- if (tender.endDate.getTime() < now) {
|
|
|
|
|
|
|
+ var now = new Date() + 1; // 投标截止日为当天的均可以提交
|
|
|
|
|
+ if (tender.endDate < now) {
|
|
|
toaster.pop('warning', '警告', '单据已过期,请重新设置日期');
|
|
toaster.pop('warning', '警告', '单据已过期,请重新设置日期');
|
|
|
} else {
|
|
} else {
|
|
|
toaster.pop('info', '提示', '正在发布,请稍候');
|
|
toaster.pop('info', '提示', '正在发布,请稍候');
|
|
@@ -10010,6 +10076,57 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
};
|
|
};
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 招标单批量导入
|
|
|
|
|
+ */
|
|
|
|
|
+ app.controller('PurcTenderUploadCtrl', ['$scope', 'toaster', '$upload', '$modalInstance', function($scope, toaster, $upload, $modalInstance) {
|
|
|
|
|
+ // 通过excel批量上传物料
|
|
|
|
|
+ $scope.result = null;
|
|
|
|
|
+ $scope.upload = function() {
|
|
|
|
|
+ var file = $scope.myFiles[0];
|
|
|
|
|
+ $upload.upload({
|
|
|
|
|
+ url: 'tender/release/excel',
|
|
|
|
|
+ file: file,
|
|
|
|
|
+ method: 'POST'
|
|
|
|
|
+ }).success(function(data) {
|
|
|
|
|
+ console.log(data);
|
|
|
|
|
+ $scope.result = data;
|
|
|
|
|
+ $scope.success = $scope.result.success;
|
|
|
|
|
+ $scope.total = $scope.result.total;
|
|
|
|
|
+ $scope.alters = $scope.result.alters;
|
|
|
|
|
+ }).error(function(response) {
|
|
|
|
|
+ toaster.pop('error', response.data || response);
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 查看范例
|
|
|
|
|
+ $scope.showImg = function() {
|
|
|
|
|
+ var src = "static/img/eg/uploadByBatch_example.png", box = $('#image-box');
|
|
|
|
|
+ box.show();
|
|
|
|
|
+ box.find('img').attr('src', src);
|
|
|
|
|
+ box.find('a').click(function(){
|
|
|
|
|
+ box.hide();
|
|
|
|
|
+ });
|
|
|
|
|
+ box.dblclick(function(){
|
|
|
|
|
+ box.hide();
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 下载模板
|
|
|
|
|
+ $scope.download = function() {
|
|
|
|
|
+ window.location.href = 'tender/upload/template';
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.enSure = function() {
|
|
|
|
|
+ $modalInstance.close($scope.result.items);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $scope.cancel = function() {
|
|
|
|
|
+ $modalInstance.dismiss();
|
|
|
|
|
+ }
|
|
|
|
|
+ }]);
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 评标
|
|
* 评标
|
|
|
*/
|
|
*/
|
|
@@ -10029,6 +10146,18 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
evaluation();
|
|
evaluation();
|
|
|
|
|
+ $scope.orderType = 'price';
|
|
|
|
|
+ $scope.dir = '-';
|
|
|
|
|
+
|
|
|
|
|
+ // 改变排序顺序
|
|
|
|
|
+ $scope.changeOrder = function(type){
|
|
|
|
|
+ $scope.orderType = type;
|
|
|
|
|
+ if(!$scope.dir || $scope.dir === '') {
|
|
|
|
|
+ $scope.dir = '-';
|
|
|
|
|
+ }else {
|
|
|
|
|
+ $scope.dir = '';
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
$scope.submit = function(tender) {
|
|
$scope.submit = function(tender) {
|
|
|
PurcTender.decide(tender, function(){
|
|
PurcTender.decide(tender, function(){
|
|
@@ -10228,16 +10357,25 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
* 采购方查看供应商投标单
|
|
* 采购方查看供应商投标单
|
|
|
*/
|
|
*/
|
|
|
app.controller('SaleVendorTenderDetailCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope) {
|
|
app.controller('SaleVendorTenderDetailCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope) {
|
|
|
- PurcTender.getVendorTenderItem({vendUU:$stateParams.vendUU, id: $stateParams.id}, function(data){
|
|
|
|
|
- $scope.item = data; // 供应商查看
|
|
|
|
|
- $scope.loading = false;
|
|
|
|
|
- }, function(response){
|
|
|
|
|
- $scope.loading = false;
|
|
|
|
|
- toaster.pop('error', '数据加载失败', response.data);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // PurcTender.getVendorTenderItem({vendUU:$stateParams.vendUU, id: $stateParams.id}, function(data){
|
|
|
|
|
+ // $scope.item = data; // 供应商查看
|
|
|
|
|
+ // $scope.loading = false;
|
|
|
|
|
+ // }, function(response){
|
|
|
|
|
+ // $scope.loading = false;
|
|
|
|
|
+ // toaster.pop('error', '数据加载失败', response.data);
|
|
|
|
|
+ // });
|
|
|
|
|
+ console.log($stateParams);
|
|
|
PurcTender.getOne({id: $stateParams.id}, function(data){
|
|
PurcTender.getOne({id: $stateParams.id}, function(data){
|
|
|
- $scope.bid = data; // 用于展示
|
|
|
|
|
|
|
+ $scope.bid = data;
|
|
|
|
|
+ angular.forEach(data.purchaseTenderProds, function(tenderProd) {
|
|
|
|
|
+ angular.forEach(tenderProd.saleTenderItems, function(saleTenderItem) {
|
|
|
|
|
+ if (saleTenderItem.saleTender.vendUU == $stateParams.vendUU) {// 与传出的参数venUU相等,即为查看企业对应的明细
|
|
|
|
|
+ tenderProd.currentItem = saleTenderItem;
|
|
|
|
|
+ $scope.saleTender = saleTenderItem.saleTender;
|
|
|
|
|
+ $scope.currentEnBaseInfo = saleTenderItem.saleTender.enterpriseBaseInfo;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
}, function(response){
|
|
}, function(response){
|
|
|
toaster.pop('error', '数据加载失败', response.data);
|
|
toaster.pop('error', '数据加载失败', response.data);
|
|
|
});
|
|
});
|
|
@@ -10250,6 +10388,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
app.controller('SaleTenderDetailCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', '$upload', 'AccountEnterprise', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, $upload, AccountEnterprise) {
|
|
app.controller('SaleTenderDetailCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', '$upload', 'AccountEnterprise', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, $upload, AccountEnterprise) {
|
|
|
|
|
|
|
|
$scope.itemStatusTodo = true;
|
|
$scope.itemStatusTodo = true;
|
|
|
|
|
+ $scope.attaches = []; // 存放上传了的附件
|
|
|
// var staticItem = null;
|
|
// var staticItem = null;
|
|
|
// $scope.loading = true;
|
|
// $scope.loading = true;
|
|
|
|
|
|
|
@@ -10271,16 +10410,18 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
|
|
|
|
|
AccountEnterprise.get({}, function(data){
|
|
AccountEnterprise.get({}, function(data){
|
|
|
$scope.currentEn = data;
|
|
$scope.currentEn = data;
|
|
|
- console.log(data);
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
PurcTender.getOne({id: $stateParams.id}, function(data){
|
|
PurcTender.getOne({id: $stateParams.id}, function(data){
|
|
|
$scope.bid = data;
|
|
$scope.bid = data;
|
|
|
|
|
+ console.log(data);
|
|
|
angular.forEach(data.purchaseTenderProds, function(tenderProd) {
|
|
angular.forEach(data.purchaseTenderProds, function(tenderProd) {
|
|
|
angular.forEach(tenderProd.saleTenderItems, function(saleTenderItem) {
|
|
angular.forEach(tenderProd.saleTenderItems, function(saleTenderItem) {
|
|
|
if (saleTenderItem.saleTender.vendUU == $scope.currentEn.uu) {
|
|
if (saleTenderItem.saleTender.vendUU == $scope.currentEn.uu) {
|
|
|
tenderProd.currentItem = saleTenderItem;
|
|
tenderProd.currentItem = saleTenderItem;
|
|
|
$scope.saleTender = saleTenderItem.saleTender;
|
|
$scope.saleTender = saleTenderItem.saleTender;
|
|
|
|
|
+ $scope.attaches = saleTenderItem.saleTender.bidAttaches;
|
|
|
|
|
+ console.log($scope.attaches);
|
|
|
$scope.currentEnBaseInfo = saleTenderItem.saleTender.enterpriseBaseInfo;
|
|
$scope.currentEnBaseInfo = saleTenderItem.saleTender.enterpriseBaseInfo;
|
|
|
if (tenderProd.currentItem.price != null) { // 为投标时
|
|
if (tenderProd.currentItem.price != null) { // 为投标时
|
|
|
$scope.itemStatusTodo = false;
|
|
$scope.itemStatusTodo = false;
|
|
@@ -10292,8 +10433,6 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
toaster.pop('error', '数据加载失败', response.data);
|
|
toaster.pop('error', '数据加载失败', response.data);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- $scope.attaches = []; // 存放上传了的附件
|
|
|
|
|
-
|
|
|
|
|
$scope.upload = function(myFile) { // 上传附件
|
|
$scope.upload = function(myFile) { // 上传附件
|
|
|
var file = $scope.myFile, file = file && file.length > 0 ? file : null;
|
|
var file = $scope.myFile, file = file && file.length > 0 ? file : null;
|
|
|
$upload.upload({
|
|
$upload.upload({
|