|
|
@@ -36,6 +36,78 @@ define(['app/app'], function (app) {
|
|
|
deadline: true
|
|
|
};
|
|
|
|
|
|
+ // 买家求购列表
|
|
|
+ $scope.searchStatus = 0;
|
|
|
+ $scope.seekPurchaseTableParams = new ngTableParams({
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 10
|
|
|
+ }, {
|
|
|
+ total: 0,
|
|
|
+ getData: function ($defer, params) {
|
|
|
+ const param = BaseService.parseParams(params.url());
|
|
|
+ param.userUU = $scope.userInfo.userUU;
|
|
|
+ if ($scope.userInfo.enterprise) {
|
|
|
+ param.enUU = $scope.userInfo.enterprise.uu;
|
|
|
+ }
|
|
|
+ // param.isMallGoods = $scope.isMallGoods;
|
|
|
+ // param.deadline = $scope.deadline;
|
|
|
+ param.keyword = $scope.keyWord;
|
|
|
+ param.state = $scope.searchStatus;
|
|
|
+ param.overdue = $scope.overdue;
|
|
|
+ param.fromDate = $scope.startDate
|
|
|
+ ? $scope.startDate.getTime() : null;
|
|
|
+ param.endDate = $scope.endDate ? $scope.endDate.getTime()
|
|
|
+ : null;
|
|
|
+ param.pageNumber = param.page;
|
|
|
+ param.pageSize = param.count;
|
|
|
+ if ($scope.isSearch) {
|
|
|
+ param.page = 1;
|
|
|
+ params.page(1);
|
|
|
+ $scope.isSearch = false;
|
|
|
+ }
|
|
|
+ seekPurchase.getUserSeekPageInfo(param, function (data) {
|
|
|
+ params.total(data.totalElements);
|
|
|
+ $defer.resolve(data.content);
|
|
|
+ $scope.seekListData = data;
|
|
|
+ }, function (response) {
|
|
|
+ toaster.pop('error', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $scope.bomSearch = {};
|
|
|
+ $scope.bomTableParams = new ngTableParams({
|
|
|
+ page: 1,
|
|
|
+ count: 10
|
|
|
+ }, {
|
|
|
+ total: 0,
|
|
|
+ getData: function ($defer, params) {
|
|
|
+ const param = BaseService.parseParams(params.url());
|
|
|
+ param.userUU = $scope.userInfo.userUU;
|
|
|
+ if ($scope.userInfo.enterprise.uu) {
|
|
|
+ param.enUU = $scope.userInfo.enterprise.uu;
|
|
|
+ }
|
|
|
+ // param.minReleaseDate = $scope.bomSearch.startDate
|
|
|
+ // ? $scope.bomSearch.startDate.getTime() : null;
|
|
|
+ // param.maxReleaseDate = $scope.bomSearch.endDate ? $scope.bomSearch.endDate.getTime()
|
|
|
+ // : null;
|
|
|
+ // param.name = $scope.bomSearch.name;
|
|
|
+ // 返回首页
|
|
|
+ if ($scope.isSearch) {
|
|
|
+ param.page = 1;
|
|
|
+ params.page(1);
|
|
|
+ $scope.isSearch = false;
|
|
|
+ }
|
|
|
+ seekPurchase.getSeekPurchaseBomListPage(param, function (data) {
|
|
|
+ params.total(data.totalElements);
|
|
|
+ $scope.bomTotal = data.totalElements;
|
|
|
+ $defer.resolve(data.content);
|
|
|
+ }, function (response) {
|
|
|
+ toaster.pop('error', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
var getRealLen = function (str) {
|
|
|
var len = 0;
|
|
|
for (var i = 0; i < str.length; i++) {
|
|
|
@@ -199,14 +271,18 @@ define(['app/app'], function (app) {
|
|
|
var inquiry = {};
|
|
|
var inquiryItem = {};
|
|
|
inquiry.recorderUU = $scope.userInfo.userUU;
|
|
|
- inquiry.enUU = $scope.userInfo.enterprise.uu;
|
|
|
+ if ($scope.userInfo.enterprise) {
|
|
|
+ inquiry.enUU = $scope.userInfo.enterprise.uu;
|
|
|
+ }
|
|
|
inquiry.code = "MALL" + $filter('date')(new Date, 'yyyyMMddsss');
|
|
|
inquiry.date = new Date();
|
|
|
inquiry.recorder = $scope.userInfo.userName;
|
|
|
inquiry.endDate = $scope.applyObj.deadline;
|
|
|
inquiry.sourceapp = "MALL";
|
|
|
inquiry.amount = 1;
|
|
|
+ inquiryItem.prodTitle = $scope.applyObj.code;
|
|
|
inquiryItem.userUU = $scope.userInfo.userUU;
|
|
|
+ inquiryItem.source = "MALL";
|
|
|
inquiryItem.userName = $scope.userInfo.userName;
|
|
|
inquiryItem.userTel = $scope.userInfo.userTel;
|
|
|
inquiryItem.needquantity = $scope.applyObj.amount;
|
|
|
@@ -276,39 +352,6 @@ define(['app/app'], function (app) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 买家求购列表
|
|
|
- $scope.searchStatus = 0;
|
|
|
- $scope.seekPurchaseTableParams = new ngTableParams({
|
|
|
- pageNumber: 1,
|
|
|
- pageSize: 10
|
|
|
- }, {
|
|
|
- total: 0,
|
|
|
- getData: function ($defer, params) {
|
|
|
- const param = BaseService.parseParams(params.url());
|
|
|
- param.userUU = $scope.userInfo.userUU;
|
|
|
- param.enUU = $scope.userInfo.enterprise.uu;
|
|
|
- // param.isMallGoods = $scope.isMallGoods;
|
|
|
- // param.deadline = $scope.deadline;
|
|
|
- param.keyword = $scope.keyWord;
|
|
|
- // param.status = $scope.searchStatus;
|
|
|
- param.fromDate = $scope.startDate
|
|
|
- ? $scope.startDate.getTime() : null;
|
|
|
- param.endDate = $scope.endDate ? $scope.endDate.getTime()
|
|
|
- : null;
|
|
|
- if ($scope.isSearch) {
|
|
|
- param.page = 1;
|
|
|
- params.page(1);
|
|
|
- $scope.isSearch = false;
|
|
|
- }
|
|
|
- seekPurchase.getUserSeekPageInfo(param, function (data) {
|
|
|
- params.total(data.totalElements);
|
|
|
- $defer.resolve(data.content);
|
|
|
- $scope.seekListData = data;
|
|
|
- }, function (response) {
|
|
|
- toaster.pop('error', response.data);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
|
|
|
// 搜索
|
|
|
$scope.onSearch = function (searchStatus) {
|
|
|
@@ -325,27 +368,32 @@ define(['app/app'], function (app) {
|
|
|
}
|
|
|
}
|
|
|
// 采纳报价
|
|
|
- $scope.adopt = function () {
|
|
|
- if (!$scope.purchaseQuantity) {
|
|
|
- toaster.pop('error', "请输入正确的采购数量");
|
|
|
- return;
|
|
|
- }
|
|
|
- seekPurchase.updateSeekPurchaseStatus({
|
|
|
- spId: $scope.currentOffer.spId,
|
|
|
- ofId: $scope.currentOffer.id,
|
|
|
- purchaseQuantity: $scope.purchaseQuantity
|
|
|
- }, {}, function (data) {
|
|
|
- if (data.success) {
|
|
|
- $scope.currentOffer = null;
|
|
|
- $scope.seekPurchaseTableParams.reload();
|
|
|
- $scope.showUseFlag = false;
|
|
|
- toaster.pop('success', '采纳报价成功');
|
|
|
- } else {
|
|
|
- toaster.pop('error', data.message);
|
|
|
- }
|
|
|
- }, function (response) {
|
|
|
+ $scope.adopt = function (id) {
|
|
|
+ seekPurchase.updateSeekPurchaseStatus({id: id, status: 1},{},function(){
|
|
|
+ toaster.pop('success', '采纳报价成功');
|
|
|
+ }, function(response){
|
|
|
toaster.pop('error', response.data);
|
|
|
});
|
|
|
+ // if (!$scope.purchaseQuantity) {
|
|
|
+ // toaster.pop('error', "请输入正确的采购数量");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // seekPurchase.updateSeekPurchaseStatus({
|
|
|
+ // spId: $scope.currentOffer.spId,
|
|
|
+ // ofId: $scope.currentOffer.id,
|
|
|
+ // purchaseQuantity: $scope.purchaseQuantity
|
|
|
+ // }, {}, function (data) {
|
|
|
+ // if (data.success) {
|
|
|
+ // $scope.currentOffer = null;
|
|
|
+ // $scope.seekPurchaseTableParams.reload();
|
|
|
+ // $scope.showUseFlag = false;
|
|
|
+ // toaster.pop('success', '采纳报价成功');
|
|
|
+ // } else {
|
|
|
+ // toaster.pop('error', data.message);
|
|
|
+ // }
|
|
|
+ // }, function (response) {
|
|
|
+ // toaster.pop('error', response.data);
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
$scope.offerCount = 0;
|
|
|
@@ -353,19 +401,20 @@ define(['app/app'], function (app) {
|
|
|
$scope.currentSeek = {};
|
|
|
$scope.setSeekStatus = function (seek, status) {
|
|
|
$scope.offerCount = seek.offerAmount;
|
|
|
- $scope.goodsCount = seek.goodsAmount;
|
|
|
+ $scope.goodsCount = 0;
|
|
|
$scope.currentSeek = seek;
|
|
|
// 查看报价
|
|
|
if (status == 2 && $scope.offerCount != 0) {
|
|
|
seekPurchase.getSeekPurchaseOfferPageInfo(
|
|
|
- {count: 100, page: 1, spId: seek.spId}, function (data) {
|
|
|
- $scope.offer = data.content;
|
|
|
+ {id: seek.id}, function (data) {
|
|
|
+ $scope.offer = data.inquiryItems;
|
|
|
clearSeekStatus();
|
|
|
seek.$status = status;
|
|
|
});
|
|
|
} else if (status == 1 && $scope.goodsCount != 0) {// 查看现货
|
|
|
seekPurchase.getMallGoodsList({spId: seek.spId}, function (data) {
|
|
|
$scope.goods = data;
|
|
|
+ $scope.goodsCount = data.length;
|
|
|
clearSeekStatus();
|
|
|
initFragments();
|
|
|
seek.$status = status;
|
|
|
@@ -719,34 +768,7 @@ define(['app/app'], function (app) {
|
|
|
toaster.pop('error', response.data);
|
|
|
});
|
|
|
};
|
|
|
- $scope.bomSearch = {};
|
|
|
- $scope.bomTableParams = new ngTableParams({
|
|
|
- page: 1,
|
|
|
- count: 10
|
|
|
- }, {
|
|
|
- total: 0,
|
|
|
- getData: function ($defer, params) {
|
|
|
- const param = BaseService.parseParams(params.url());
|
|
|
- param.minReleaseDate = $scope.bomSearch.startDate
|
|
|
- ? $scope.bomSearch.startDate.getTime() : null;
|
|
|
- param.maxReleaseDate = $scope.bomSearch.endDate ? $scope.bomSearch.endDate.getTime()
|
|
|
- : null;
|
|
|
- param.name = $scope.bomSearch.name;
|
|
|
- // 返回首页
|
|
|
- if ($scope.isSearch) {
|
|
|
- param.page = 1;
|
|
|
- params.page(1);
|
|
|
- $scope.isSearch = false;
|
|
|
- }
|
|
|
- seekPurchase.getSeekPurchaseBomListPage(param, function (data) {
|
|
|
- params.total(data.totalElements);
|
|
|
- $scope.bomTotal = data.totalElements;
|
|
|
- $defer.resolve(data.content);
|
|
|
- }, function (response) {
|
|
|
- toaster.pop('error', response.data);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
// 搜索
|
|
|
$scope.onBomSearch = function () {
|
|
|
$scope.isSearch = true;
|