|
@@ -914,37 +914,151 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
}
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
- app.controller('PagingReleaseCtrl', ['$scope', 'PagingRelease', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'PagingReleaseInfo', function ($scope, PagingRelease, BaseService, ngTableParams, toaster, $modalInstance, PagingReleaseInfo) {
|
|
|
|
|
- // BaseService.scrollBackToTop();
|
|
|
|
|
- $scope.active = "todo";
|
|
|
|
|
- $scope.searchStatus = false; // 默认从数据库直接获取
|
|
|
|
|
- $scope.setActive = function (state) {
|
|
|
|
|
- if ($scope.active != state) {
|
|
|
|
|
- $scope.active = state;
|
|
|
|
|
- if ($scope.tableParams.page() == 1)
|
|
|
|
|
- $scope.tableParams.reload();
|
|
|
|
|
- else
|
|
|
|
|
- $scope.tableParams.page(1);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 原消息提醒
|
|
|
|
|
+ */
|
|
|
|
|
+ // app.controller('PagingReleaseCtrl', ['$scope', 'PagingRelease', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'PagingReleaseInfo', function ($scope, PagingRelease, BaseService, ngTableParams, toaster, $modalInstance, PagingReleaseInfo) {
|
|
|
|
|
+ // // BaseService.scrollBackToTop();
|
|
|
|
|
+ // $scope.active = "todo";
|
|
|
|
|
+ // $scope.searchStatus = false; // 默认从数据库直接获取
|
|
|
|
|
+ // $scope.setActive = function (state) {
|
|
|
|
|
+ // if ($scope.active != state) {
|
|
|
|
|
+ // $scope.active = state;
|
|
|
|
|
+ // if ($scope.tableParams.page() == 1)
|
|
|
|
|
+ // $scope.tableParams.reload();
|
|
|
|
|
+ // else
|
|
|
|
|
+ // $scope.tableParams.page(1);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // var getService = function () {
|
|
|
|
|
+ // if ($scope.searchStatus) {
|
|
|
|
|
+ // return PagingRelease;
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // return PagingReleaseInfo;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // $scope.tableParams = new ngTableParams({
|
|
|
|
|
+ // page: 1,
|
|
|
|
|
+ // count: 20,
|
|
|
|
|
+ // sorting: {
|
|
|
|
|
+ // 'id': 'desc'
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }, {
|
|
|
|
|
+ // total: 0,
|
|
|
|
|
+ // counts: [5, 10, 25, 50],
|
|
|
|
|
+ // getData: function ($defer, params) {
|
|
|
|
|
+ // $scope.loading = true;
|
|
|
|
|
+ // var pageParams = params.url();
|
|
|
|
|
+ // var realActive = {};
|
|
|
|
|
+ // pageParams.searchFilter = { // 筛选条件
|
|
|
|
|
+ // keyword: $scope.keyword
|
|
|
|
|
+ // // fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
|
|
+ // // endDate: getDateTime($scope.condition.dateTo)
|
|
|
|
|
+ // };
|
|
|
|
|
+ // // AccountEnterprise.get({}, function(data){
|
|
|
|
|
+ // // $scope.currentEn = data;
|
|
|
|
|
+ // // });
|
|
|
|
|
+ // getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
|
|
+ // $scope.loading = false;
|
|
|
|
|
+ // if (page) {
|
|
|
|
|
+ // params.total(page.totalElement);
|
|
|
|
|
+ // $defer.resolve(page.content);
|
|
|
|
|
+ // // $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }, function (response) {
|
|
|
|
|
+ // $scope.loading = false;
|
|
|
|
|
+ // toaster.pop('error', '数据加载失败', response.data);
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ //
|
|
|
|
|
+ // $scope.close = function () {
|
|
|
|
|
+ // $modalInstance.close();
|
|
|
|
|
+ // window.location.reload();
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ //
|
|
|
|
|
+ // $scope.checks = {
|
|
|
|
|
+ // checked: false
|
|
|
|
|
+ // };// 全选框
|
|
|
|
|
+ //
|
|
|
|
|
+ // $scope.checkAll = function () {
|
|
|
|
|
+ // angular.forEach($scope.tableParams.data, function (message) {
|
|
|
|
|
+ // message.checked = $scope.checks.checked;
|
|
|
|
|
+ // });
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // // 单选
|
|
|
|
|
+ // $scope.checkOne = function (vendor) {
|
|
|
|
|
+ // vendor.checked = true;
|
|
|
|
|
+ //
|
|
|
|
|
+ // var checked = true;
|
|
|
|
|
+ // angular.forEach($scope.tableParams.data, function (message) { // 单选全部时,全选选中
|
|
|
|
|
+ // if (!message.checked) {
|
|
|
|
|
+ // checked = false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // $scope.checks.checked = checked;
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // // 单反选
|
|
|
|
|
+ // $scope.unCheckOne = function (vendor) {
|
|
|
|
|
+ // vendor.checked = false;
|
|
|
|
|
+ // $scope.checks.checked = false;
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // // 标为已读
|
|
|
|
|
+ // $scope.setRead = function () {
|
|
|
|
|
+ // var selectedMessages = [];
|
|
|
|
|
+ // angular.forEach($scope.tableParams.data, function (message) {
|
|
|
|
|
+ // if (message.checked) {
|
|
|
|
|
+ // selectedMessages.push(message);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // PagingRelease.setRead({}, selectedMessages, function (message) {
|
|
|
|
|
+ // $scope.checks = {
|
|
|
|
|
+ // checked: false
|
|
|
|
|
+ // };
|
|
|
|
|
+ // toaster.pop("success", "成功", "设置成功");
|
|
|
|
|
+ // $scope.tableParams.page(1);
|
|
|
|
|
+ // $scope.tableParams.reload();
|
|
|
|
|
+ // });
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // // 点击内容连接之后,信息标为已读
|
|
|
|
|
+ // $scope.setOneRead = function (id) {
|
|
|
|
|
+ // $modalInstance.close();
|
|
|
|
|
+ // PagingRelease.setOneRead({id: id}, {}, function (data) {
|
|
|
|
|
+ // }, function (response) {
|
|
|
|
|
+ // toaster.pop('error', '提示', response.data);
|
|
|
|
|
+ // });
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // // 搜索框回车
|
|
|
|
|
+ // $scope.onSearch = function () {
|
|
|
|
|
+ // $scope.searchStatus = true;
|
|
|
|
|
+ // $scope.tableParams.page(1);
|
|
|
|
|
+ // $scope.tableParams.reload();
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // }]);
|
|
|
|
|
|
|
|
- var getService = function () {
|
|
|
|
|
- if ($scope.searchStatus) {
|
|
|
|
|
- return PagingRelease;
|
|
|
|
|
- } else {
|
|
|
|
|
- return PagingReleaseInfo;
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 新消息提醒(调用公共服务接口) -2018-01-22 19:36:50
|
|
|
|
|
+ */
|
|
|
|
|
+ app.controller('PagingReleaseCtrl', ['$scope', 'PagingRelease', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'PagingReleaseInfo', function ($scope, PagingRelease, BaseService, ngTableParams, toaster, $modalInstance, PagingReleaseInfo) {
|
|
|
|
|
|
|
|
$scope.tableParams = new ngTableParams({
|
|
$scope.tableParams = new ngTableParams({
|
|
|
page: 1,
|
|
page: 1,
|
|
|
- count: 20,
|
|
|
|
|
|
|
+ count: 10,
|
|
|
sorting: {
|
|
sorting: {
|
|
|
- 'pagingRelease.date': 'desc'
|
|
|
|
|
|
|
+ 'id': 'desc'
|
|
|
}
|
|
}
|
|
|
}, {
|
|
}, {
|
|
|
total: 0,
|
|
total: 0,
|
|
|
- counts: [5, 10, 25, 50],
|
|
|
|
|
|
|
+ counts: [],
|
|
|
getData: function ($defer, params) {
|
|
getData: function ($defer, params) {
|
|
|
$scope.loading = true;
|
|
$scope.loading = true;
|
|
|
var pageParams = params.url();
|
|
var pageParams = params.url();
|
|
@@ -954,13 +1068,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// fromDate: getDateTime($scope.condition.dateFrom),
|
|
// fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
// endDate: getDateTime($scope.condition.dateTo)
|
|
// endDate: getDateTime($scope.condition.dateTo)
|
|
|
};
|
|
};
|
|
|
- // AccountEnterprise.get({}, function(data){
|
|
|
|
|
- // $scope.currentEn = data;
|
|
|
|
|
- // });
|
|
|
|
|
- getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
|
|
|
|
+ PagingRelease.getMessage.call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
$scope.loading = false;
|
|
$scope.loading = false;
|
|
|
if (page) {
|
|
if (page) {
|
|
|
- params.total(page.totalElement);
|
|
|
|
|
|
|
+ params.total(page.totalElements);
|
|
|
$defer.resolve(page.content);
|
|
$defer.resolve(page.content);
|
|
|
// $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
// $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
|
}
|
|
}
|
|
@@ -1006,19 +1117,23 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.checks.checked = false;
|
|
$scope.checks.checked = false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- // 标为已读
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 当前页标为已读
|
|
|
|
|
+ */
|
|
|
$scope.setRead = function () {
|
|
$scope.setRead = function () {
|
|
|
- var selectedMessages = [];
|
|
|
|
|
- angular.forEach($scope.tableParams.data, function (message) {
|
|
|
|
|
- if (message.checked) {
|
|
|
|
|
- selectedMessages.push(message);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $scope.loading = true;
|
|
|
|
|
+ var messageIds = [];
|
|
|
|
|
+ angular.forEach($scope.tableParams.data, function(message) {
|
|
|
|
|
+ messageIds.push(message.id);
|
|
|
});
|
|
});
|
|
|
- PagingRelease.setRead({}, selectedMessages, function (message) {
|
|
|
|
|
- $scope.checks = {
|
|
|
|
|
- checked: false
|
|
|
|
|
- };
|
|
|
|
|
- toaster.pop("success", "成功", "设置成功");
|
|
|
|
|
|
|
+ PagingRelease.setPageRead({}, messageIds, function (data) {
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ if (data.success) {
|
|
|
|
|
+ toaster.pop("success", "设置已读成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (data.error) {
|
|
|
|
|
+ toaster.pop("error", "设置已读失败");
|
|
|
|
|
+ }
|
|
|
$scope.tableParams.page(1);
|
|
$scope.tableParams.page(1);
|
|
|
$scope.tableParams.reload();
|
|
$scope.tableParams.reload();
|
|
|
});
|
|
});
|
|
@@ -1027,7 +1142,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// 点击内容连接之后,信息标为已读
|
|
// 点击内容连接之后,信息标为已读
|
|
|
$scope.setOneRead = function (id) {
|
|
$scope.setOneRead = function (id) {
|
|
|
$modalInstance.close();
|
|
$modalInstance.close();
|
|
|
- PagingRelease.setOneRead({id: id}, {}, function (data) {
|
|
|
|
|
|
|
+ PagingRelease.setMessageRead({id: id}, {}, function (data) {
|
|
|
}, function (response) {
|
|
}, function (response) {
|
|
|
toaster.pop('error', '提示', response.data);
|
|
toaster.pop('error', '提示', response.data);
|
|
|
});
|
|
});
|
|
@@ -1035,13 +1150,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
|
|
// 搜索框回车
|
|
// 搜索框回车
|
|
|
$scope.onSearch = function () {
|
|
$scope.onSearch = function () {
|
|
|
- $scope.searchStatus = true;
|
|
|
|
|
$scope.tableParams.page(1);
|
|
$scope.tableParams.page(1);
|
|
|
$scope.tableParams.reload();
|
|
$scope.tableParams.reload();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// 高亮显示关键词
|
|
// 高亮显示关键词
|
|
|
app.filter('getkey', ['$sce', '$rootScope', function ($sce, $rootScope) {
|
|
app.filter('getkey', ['$sce', '$rootScope', function ($sce, $rootScope) {
|
|
|
var search = $rootScope.searchKeyword;
|
|
var search = $rootScope.searchKeyword;
|
|
@@ -5412,6 +5527,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// 转客户询价
|
|
// 转客户询价
|
|
|
$scope.transtoInquiry = function (inquiryItem) {
|
|
$scope.transtoInquiry = function (inquiryItem) {
|
|
|
publicInquiry.quotationInfo({id: inquiryItem.id}, function(data) {
|
|
publicInquiry.quotationInfo({id: inquiryItem.id}, function(data) {
|
|
|
|
|
+ console.log(data);
|
|
|
if (data.inquiryItem) { //存在已报价的就不进行报价操作
|
|
if (data.inquiryItem) { //存在已报价的就不进行报价操作
|
|
|
toaster.pop('error', '该询价单已已经报价');
|
|
toaster.pop('error', '该询价单已已经报价');
|
|
|
} else {
|
|
} else {
|
|
@@ -5489,26 +5605,27 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
|
|
// 保存报价信息
|
|
// 保存报价信息
|
|
|
$scope.save = function(inquiryItem, method) {
|
|
$scope.save = function(inquiryItem, method) {
|
|
|
- var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
|
|
|
|
|
- $upload.upload({
|
|
|
|
|
- url: 'pubInquiry/turnToQuotation',
|
|
|
|
|
- file: file,
|
|
|
|
|
- method: 'POST',
|
|
|
|
|
- data: {
|
|
|
|
|
- item: inquiryItem,
|
|
|
|
|
- method: method
|
|
|
|
|
- }
|
|
|
|
|
- }).success(function (data) {
|
|
|
|
|
- if (data.item) {
|
|
|
|
|
- item = data.item;
|
|
|
|
|
- }
|
|
|
|
|
- $scope.loading = false;
|
|
|
|
|
- toaster.pop('info', '提示', '报价成功');
|
|
|
|
|
- $modalInstance.close();
|
|
|
|
|
- }).error(function (data) {
|
|
|
|
|
- $scope.loading = false;
|
|
|
|
|
- toaster.pop('error', '附件上传失败');
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ console.log(inquiryItem);
|
|
|
|
|
+ // var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
|
|
|
|
|
+ // $upload.upload({
|
|
|
|
|
+ // url: 'pubInquiry/turnToQuotation',
|
|
|
|
|
+ // file: file,
|
|
|
|
|
+ // method: 'POST',
|
|
|
|
|
+ // data: {
|
|
|
|
|
+ // item: inquiryItem,
|
|
|
|
|
+ // method: method
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }).success(function (data) {
|
|
|
|
|
+ // if (data.item) {
|
|
|
|
|
+ // item = data.item;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // $scope.loading = false;
|
|
|
|
|
+ // toaster.pop('info', '提示', '报价成功');
|
|
|
|
|
+ // $modalInstance.close();
|
|
|
|
|
+ // }).error(function (data) {
|
|
|
|
|
+ // $scope.loading = false;
|
|
|
|
|
+ // toaster.pop('error', '附件上传失败');
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$scope.previewShow = false;
|
|
$scope.previewShow = false;
|
|
@@ -5560,7 +5677,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
/**
|
|
/**
|
|
|
* 公共询价详情
|
|
* 公共询价详情
|
|
|
*/
|
|
*/
|
|
|
- app.controller('PublicInquiryListDetailCtrl', ['$scope', '$stateParams', 'PurchaseInquiry', '$filter', 'toaster', 'BaseService', 'ngTableParams', 'AccountEnterprise', 'publicInquiry', 'publicInquiryList', '$modal', function ($scope, $stateParams, PurchaseInquiry, $filter, toaster, BaseService, ngTableParams, AccountEnterprise, publicInquiry, publicInquiryList, $modal) {
|
|
|
|
|
|
|
+ app.controller('PublicInquiryListDetailCtrl', ['$scope', '$stateParams', 'PurchaseInquiry', '$filter', 'toaster', 'BaseService', 'ngTableParams', 'AccountEnterprise', 'publicInquiry', 'publicInquiryList', function ($scope, $stateParams, PurchaseInquiry, $filter, toaster, BaseService, ngTableParams, AccountEnterprise, publicInquiry, publicInquiryList) {
|
|
|
BaseService.scrollBackToTop();
|
|
BaseService.scrollBackToTop();
|
|
|
$scope.currentHasBid = false;
|
|
$scope.currentHasBid = false;
|
|
|
var loadData = function () {
|
|
var loadData = function () {
|
|
@@ -5601,33 +5718,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('error', '提示', response.data);
|
|
toaster.pop('error', '提示', response.data);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 转客户询价
|
|
|
|
|
- $scope.transtoInquiry = function (inquiryItem) {
|
|
|
|
|
- publicInquiry.quotationInfo({id: inquiryItem.id}, function(data) {
|
|
|
|
|
- if (data.inquiryItem) { //存在已报价的就不进行报价操作
|
|
|
|
|
- toaster.pop('error', '该询价单已已经报价');
|
|
|
|
|
- } else {
|
|
|
|
|
- var modalInstance = $modal.open({
|
|
|
|
|
- templateUrl: 'static/tpl/index/baseInfo/modal/quotation_modal.html',
|
|
|
|
|
- controller: 'QuoteCtrl',
|
|
|
|
|
- size: 'lg',
|
|
|
|
|
- resolve: {
|
|
|
|
|
- inquiryItem: function () {
|
|
|
|
|
- return inquiryItem
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- modalInstance.result.then(function (data) {
|
|
|
|
|
- $scope.tableParams.reload();
|
|
|
|
|
- }, function () {
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
// 询价单明细
|
|
// 询价单明细
|