|
|
@@ -5,60 +5,27 @@ define(['app/app'], function(app) {
|
|
|
$scope.seekPurchaseRate = {};
|
|
|
$scope.offer = {};
|
|
|
|
|
|
- // 获取当前卖家求购成交率
|
|
|
- seekPurchase.getSeekPurchaseRate(function(data) {
|
|
|
- $scope.seekPurchaseRate = data;
|
|
|
- }, function(response) {
|
|
|
- toaster.pop('error', '错误', response.data);
|
|
|
- });
|
|
|
-
|
|
|
// 获取当前卖家求购推送列表
|
|
|
- $scope.getSeekPushGoodsPageInfo = function (){
|
|
|
- $scope.seekPurchaseTableParams = new ngTableParams({
|
|
|
- page : 1,
|
|
|
- count : 5
|
|
|
- }, {
|
|
|
- total : 0,
|
|
|
- getData : function ($defer, params) {
|
|
|
- const param = BaseService.parseParams(params.url());
|
|
|
- param.deadline = $scope.deadline;
|
|
|
- param.status = $scope.status;
|
|
|
- param.keyWord = $scope.keyWord;
|
|
|
- param.minReleaseDate = $scope.startDate ? $scope.startDate.getTime() : null;
|
|
|
- param.maxReleaseDate = $scope.endDate ? $scope.endDate.getTime() : null;
|
|
|
- seekPurchase.getSeekPushGoodsPageInfo(param, function (data) {
|
|
|
- params.total(data.totalElements);
|
|
|
- $defer.resolve(data.content);
|
|
|
- }, function (response) {
|
|
|
- toaster.pop('error', '获取求购列表失败');
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // 获取我的报价列表
|
|
|
- $scope.getMyOfferPageInfo = function () {
|
|
|
- $scope.seekPurchaseTableParams = new ngTableParams({
|
|
|
- page : 1,
|
|
|
- count : 5
|
|
|
- }, {
|
|
|
- total : 0,
|
|
|
- getData : function ($defer, params) {
|
|
|
- const param = BaseService.parseParams(params.url());
|
|
|
- param.deadline = $scope.deadline;
|
|
|
- param.status = $scope.status;
|
|
|
- param.keyWord = $scope.keyWord;
|
|
|
- param.minReleaseDate = $scope.startDate ? $scope.startDate.getTime() : null;
|
|
|
- param.maxReleaseDate = $scope.endDate ? $scope.endDate.getTime() : null;
|
|
|
- seekPurchase.getMyOfferPageInfo(param, function (data) {
|
|
|
- params.total(data.totalElements);
|
|
|
- $defer.resolve(data.content);
|
|
|
- }, function (response) {
|
|
|
- toaster.pop('error', '获取求购列表失败');
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ $scope.seekPurchaseTableParams = new ngTableParams({
|
|
|
+ page : 1,
|
|
|
+ count : 5
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ getData : function ($defer, params) {
|
|
|
+ const param = BaseService.parseParams(params.url());
|
|
|
+ param.deadline = $scope.deadline;
|
|
|
+ param.status = $scope.status;
|
|
|
+ param.keyWord = $scope.keyWord;
|
|
|
+ param.minReleaseDate = $scope.startDate ? $scope.startDate.getTime() : null;
|
|
|
+ param.maxReleaseDate = $scope.endDate ? $scope.endDate.getTime() : null;
|
|
|
+ seekPurchase.getSeekPushGoodsPageInfo(param, function (data) {
|
|
|
+ params.total(data.totalElements);
|
|
|
+ $defer.resolve(data.content);
|
|
|
+ }, function (response) {
|
|
|
+ toaster.pop('error', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
// 搜索
|
|
|
$scope.onSearch = function(){
|
|
|
@@ -66,9 +33,10 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
|
|
|
|
// 保存报价
|
|
|
- $scope.saveOffer = function (){
|
|
|
+ $scope.saveOffer = function (seek){
|
|
|
seekPurchase.saveOffer($scope.offer, function(data) {
|
|
|
- $scope.setSeekActive(null, false);
|
|
|
+ $scope.setSeekActive(seek, false);
|
|
|
+ $scope.seekPurchaseTableParams.reload();
|
|
|
toaster.pop('success', '报价成功');
|
|
|
}, function (res) {
|
|
|
toaster.pop('error', '报价失败');
|