|
|
@@ -15,10 +15,70 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
$scope.bomTab = 'bomList';
|
|
|
$scope.toogleBomTab = function (tab) {
|
|
|
$scope.bomTab = tab;
|
|
|
+ if (tab == 'seekRecord') {
|
|
|
+ $scope.bomTableParams = new ngTableParams({
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ page: 1,
|
|
|
+ count: 10
|
|
|
+ }, {
|
|
|
+ total: 0,
|
|
|
+ getData: function ($defer, params) {
|
|
|
+ var param = BaseService.parseParams(params.url());
|
|
|
+ param.pageNumber = param.page
|
|
|
+ if ($scope.userInfo.enterprise) {
|
|
|
+ param.enUU = $scope.userInfo.enterprise.uu;
|
|
|
+ } else {
|
|
|
+ param.userUU = $scope.userInfo.userUU;
|
|
|
+ }
|
|
|
+ // 返回首页
|
|
|
+ if ($scope.isSearch) {
|
|
|
+ param.page = 1;
|
|
|
+ params.page(1);
|
|
|
+ $scope.isSearch = false;
|
|
|
+ }
|
|
|
+ $http({
|
|
|
+ method: 'get',
|
|
|
+ dataType: 'json',
|
|
|
+ url: $scope.seekUrl + '/inquiry/buyer/inquiryList',
|
|
|
+ params: param
|
|
|
+ }).success(function (data) {
|
|
|
+ params.total(data.totalElements);
|
|
|
+ $scope.bomTotal = data.totalElements;
|
|
|
+ $defer.resolve(data.content);
|
|
|
+ $scope.bomDataList = data
|
|
|
+ }).error(function (response) {
|
|
|
+ toaster.pop('error', response);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $scope.bomTableParams = new ngTableParams({
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 10
|
|
|
+ }, {
|
|
|
+ total: 0,
|
|
|
+ getData: function ($defer, params) {
|
|
|
+ var param = BaseService.parseParams(params.url());
|
|
|
+ param.pageNumber = param.page
|
|
|
+ seekPurchase.getBomList(param, function (data) {
|
|
|
+ params.total(data.totalElements);
|
|
|
+ $scope.bomTotal = data.totalElements;
|
|
|
+ $defer.resolve(data.content);
|
|
|
+ $scope.bomDataList = data
|
|
|
+ }, function (response) {
|
|
|
+ toaster.pop('error', response);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
$scope.toogleType = function (type) {
|
|
|
clearSeekStatus();
|
|
|
$scope.activeType = type;
|
|
|
+ if (type === 'bomManage') {
|
|
|
+ $scope.toogleBomTab('bomList');
|
|
|
+ }
|
|
|
}
|
|
|
$rootScope.ShaRETimer = {}
|
|
|
|
|
|
@@ -110,7 +170,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
$scope.setFilters('dateArea', 'sevenDay', '1')
|
|
|
|
|
|
seekPurchase.getSeekUrl({}, function(data) {
|
|
|
- var seekUrl = data.url;
|
|
|
+ $scope.seekUrl = data.url;
|
|
|
// var seekUrl = 'http://10.1.51.82:24002';
|
|
|
/*$scope.tab = 'waitOffer';*/
|
|
|
$scope.toogleTab = function (tab) {
|
|
|
@@ -147,7 +207,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
$http({
|
|
|
method: 'get',
|
|
|
dataType: 'json',
|
|
|
- url: seekUrl + '/inquiry/buyer/list',
|
|
|
+ url: $scope.seekUrl + '/inquiry/buyer/list',
|
|
|
params: param
|
|
|
}).success(function (data) {
|
|
|
params.total(data.totalElements);
|
|
|
@@ -180,7 +240,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
$http({
|
|
|
method: 'get',
|
|
|
dataType: 'json',
|
|
|
- url: seekUrl + '/inquiry/buyer/quotations',
|
|
|
+ url: $scope.seekUrl + '/inquiry/buyer/quotations',
|
|
|
params: param
|
|
|
}).success(function (data) {
|
|
|
params.total(data.totalElements);
|
|
|
@@ -223,45 +283,6 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
// 买家求购列表
|
|
|
$scope.searchStatus = 0;
|
|
|
|
|
|
-
|
|
|
- $scope.bomSearch = {};
|
|
|
- $scope.bomTableParams = new ngTableParams({
|
|
|
- pageNumber: 1,
|
|
|
- pageSize: 10,
|
|
|
- page: 1,
|
|
|
- count: 10
|
|
|
- }, {
|
|
|
- total: 0,
|
|
|
- getData: function ($defer, params) {
|
|
|
- var param = BaseService.parseParams(params.url());
|
|
|
- param.pageNumber = param.page
|
|
|
- if ($scope.userInfo.enterprise) {
|
|
|
- param.enUU = $scope.userInfo.enterprise.uu;
|
|
|
- } else {
|
|
|
- param.userUU = $scope.userInfo.userUU;
|
|
|
- }
|
|
|
- // 返回首页
|
|
|
- if ($scope.isSearch) {
|
|
|
- param.page = 1;
|
|
|
- params.page(1);
|
|
|
- $scope.isSearch = false;
|
|
|
- }
|
|
|
- $http({
|
|
|
- method: 'get',
|
|
|
- dataType: 'json',
|
|
|
- url: seekUrl + '/inquiry/buyer/inquiryList',
|
|
|
- params: param
|
|
|
- }).success(function (data) {
|
|
|
- params.total(data.totalElements);
|
|
|
- $scope.bomTotal = data.totalElements;
|
|
|
- $defer.resolve(data.content);
|
|
|
- $scope.bomDataList = data
|
|
|
- }).error(function (response) {
|
|
|
- toaster.pop('error', response);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
var getRealLen = function (str) {
|
|
|
var len = 0;
|
|
|
for (var i = 0; i < str.length; i++) {
|
|
|
@@ -503,7 +524,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
var inquiryItems = [];
|
|
|
inquiryItems.push(inquiryItem);
|
|
|
inquiry.inquiryItems = inquiryItems;
|
|
|
- if (seekUrl == 'https://api-inquiry.usoftmall.com') {
|
|
|
+ if ($scope.seekUrl == 'https://api-inquiry.usoftmall.com') {
|
|
|
seekPurchase.saveOneSeekPurchaseProd(inquiry,
|
|
|
function (data) {
|
|
|
$scope.showUseFlag = false;
|
|
|
@@ -534,8 +555,8 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
} else {
|
|
|
// 校验
|
|
|
if ($scope.checkAll()) {
|
|
|
- var materialUrl = seekUrl;
|
|
|
- if (seekUrl == 'https://api-inquiry.usoftmall.com') {
|
|
|
+ var materialUrl = $scope.seekUrl;
|
|
|
+ if ($scope.seekUrl == 'https://api-inquiry.usoftmall.com') {
|
|
|
materialUrl = 'https://api-product.usoftmall.com/';
|
|
|
}
|
|
|
$http({
|
|
|
@@ -616,7 +637,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
},
|
|
|
method: 'POST',
|
|
|
dataType: 'json',
|
|
|
- url: seekUrl + '/inquiry/buyer/adopt',
|
|
|
+ url: $scope.seekUrl + '/inquiry/buyer/adopt',
|
|
|
params: {id: of.id, status: 1}
|
|
|
}).success(function (data) {
|
|
|
toaster.pop('success', '采纳报价成功');
|
|
|
@@ -651,7 +672,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
},
|
|
|
method: 'POST',
|
|
|
dataType: 'json',
|
|
|
- url: seekUrl + '/inquiry/buyer/refuse',
|
|
|
+ url: $scope.seekUrl + '/inquiry/buyer/refuse',
|
|
|
params: {id: $scope.currentRefuseOffer.id, status: 0, refusereason: choice}
|
|
|
}).success(function (data) {
|
|
|
toaster.pop('refuse', '已拒绝报价');
|