|
|
@@ -1,6 +1,6 @@
|
|
|
-define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize', 'service/BaseInfo', 'service/Cart', 'service/ApprovalFlow', 'service/DeputyOrder', 'service/Product', 'service/Token', 'service/ProductUsers', 'service/File', 'service/PublicInquiry'], function () {
|
|
|
+define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize', 'service/BaseInfo', 'service/Cart', 'service/ApprovalFlow', 'service/DeputyOrder', 'service/Product', 'service/Token', 'service/ProductUsers', 'service/File', 'service/PublicInquiry', 'service/Customer'], function () {
|
|
|
'use strict';
|
|
|
- var app = angular.module('myApp', ['toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'common.directives', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices', 'CartServices', 'ApprvoalFlowService', 'DeputyOrderService', 'ProductInfoServices', 'TokenService', 'ProductUserService', 'ui.tour', 'FileService', 'publicInquiryService']);
|
|
|
+ var app = angular.module('myApp', ['toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'common.directives', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices', 'CartServices', 'ApprvoalFlowService', 'DeputyOrderService', 'ProductInfoServices', 'TokenService', 'ProductUserService', 'ui.tour', 'FileService', 'publicInquiryService', 'CustomerService']);
|
|
|
app.init = function () {
|
|
|
angular.bootstrap(document, ['myApp']);
|
|
|
};
|
|
|
@@ -5400,7 +5400,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}]);
|
|
|
|
|
|
// 公共询价列表
|
|
|
- app.controller('PublicInquiryListCtrl', ['$scope', '$stateParams', 'PurchaseInquiry', '$filter', 'toaster', 'BaseService', 'ngTableParams', 'PurcInquiry', 'publicInquiry', 'publicInquiryList', '$modal', '$http', 'AccountEnterprise', function ($scope, $stateParams, PurchaseInquiry, $filter, toaster, BaseService, ngTableParams, PurcInquiry, publicInquiry, publicInquiryList, $modal, $http, AccountEnterprise) {
|
|
|
+ app.controller('PublicInquiryListCtrl', ['$scope', '$stateParams', 'PurchaseInquiry', '$filter', 'toaster', 'BaseService', 'ngTableParams', 'PurcInquiry', 'publicInquiry', 'publicInquiryList', '$modal', '$http', 'AccountEnterprise', 'customer', 'AuthenticationService', function ($scope, $stateParams, PurchaseInquiry, $filter, toaster, BaseService, ngTableParams, PurcInquiry, publicInquiry, publicInquiryList, $modal, $http, AccountEnterprise, customer, AuthenticationService) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
/**
|
|
|
* 改变单据日期范围
|
|
|
@@ -5483,7 +5483,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
|
|
|
$scope.nowdate = new Date().getTime() - 24 * 3600 * 1000;
|
|
|
- var getOpenState = function (active) {
|
|
|
+ var getState = function (active) {
|
|
|
var fn = 'getOpenAll';
|
|
|
switch (active) {
|
|
|
case 'all':
|
|
|
@@ -5499,9 +5499,25 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
return fn;
|
|
|
};
|
|
|
|
|
|
+ customer.distribute({}, function(data) {
|
|
|
+ $scope.customer = data;
|
|
|
+ });
|
|
|
+
|
|
|
$scope.setActive = function (state) {
|
|
|
if ($scope.active != state) {
|
|
|
$scope.active = state;
|
|
|
+ if ($scope.active == 'all') {
|
|
|
+ $scope.distribute = null;
|
|
|
+ $scope.remind = false;
|
|
|
+ } else if ($scope.active == 'customer') {
|
|
|
+ $scope.distribute = $scope.customer;
|
|
|
+ if ($scope.distribute.length == 0) {
|
|
|
+ $scope.distribute = [1];
|
|
|
+ }
|
|
|
+ $scope.remind = false;
|
|
|
+ } else if ($scope.active == 'remind') {
|
|
|
+ $scope.remind = true;
|
|
|
+ }
|
|
|
if ($scope.tableParams.page() == 1) {
|
|
|
$scope.tableParams.reload();
|
|
|
} else {
|
|
|
@@ -5534,38 +5550,50 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
endDate: getDateTime($scope.condition.dateTo)
|
|
|
};
|
|
|
- /*getService().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);
|
|
|
- });*/
|
|
|
+
|
|
|
AccountEnterprise.get({}, function(data) {
|
|
|
$scope.currentEn = data;
|
|
|
publicInquiry.getUrl({}, function(data) {
|
|
|
- var url = data.url;
|
|
|
- $http({
|
|
|
- method: 'get',
|
|
|
- dataType: 'json',
|
|
|
- url: url + '/inquiry/public',
|
|
|
- params: {pageNumber: pageParams.page, pageSize: pageParams.count, enUU: $scope.currentEn.uu, keyword: $scope.keyword,
|
|
|
- fromDate: getDateTime($scope.condition.dateFrom), endDate: getDateTime($scope.condition.dateTo)}
|
|
|
- }).success(function (response) {
|
|
|
- $scope.loading = false;
|
|
|
- if (response) {
|
|
|
- params.total(response.totalElements);
|
|
|
- $defer.resolve(response.content);
|
|
|
- // $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
|
- }
|
|
|
- }).error(function (err) {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('error', '数据加载失败', err);
|
|
|
- });
|
|
|
+ $scope.url = data.url;
|
|
|
+ if (!$scope.remind) {// 非推荐信息
|
|
|
+ $http({
|
|
|
+ method: 'get',
|
|
|
+ dataType: 'json',
|
|
|
+ url: $scope.url + '/inquiry/public',
|
|
|
+ params: {pageNumber: pageParams.page, pageSize: pageParams.count, enUU: $scope.currentEn.uu, keyword: $scope.keyword,
|
|
|
+ fromDate: getDateTime($scope.condition.dateFrom), endDate: getDateTime($scope.condition.dateTo), distribute: $scope.distribute, remind: $scope.remind}
|
|
|
+ }).success(function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ if (response) {
|
|
|
+ params.total(response.totalElements);
|
|
|
+ $defer.resolve(response.content);
|
|
|
+ }
|
|
|
+ }).error(function (err) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', err);
|
|
|
+ });
|
|
|
+ } else {// 推荐报价信息
|
|
|
+ AuthenticationService.getAuthentication().success(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ $scope.thisUser = data;
|
|
|
+ $http({
|
|
|
+ method: 'get',
|
|
|
+ dataType: 'json',
|
|
|
+ url: $scope.url + '/inquiry/sale/remind',
|
|
|
+ params: {pageNumber: pageParams.page, pageSize: pageParams.count, useruu: $scope.thisUser.userUU, enuu: $scope.currentEn.uu,
|
|
|
+ keyword: $scope.keyword, fromDate: getDateTime($scope.condition.dateFrom), endDate: getDateTime($scope.condition.dateTo)}
|
|
|
+ }).success(function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ if (response) {
|
|
|
+ params.total(response.totalElements);
|
|
|
+ $defer.resolve(response.content);
|
|
|
+ }
|
|
|
+ }).error(function (err) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', err);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
// 顶部滚动消息
|
|
|
$http({
|
|
|
@@ -5591,6 +5619,59 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // 转客户询价
|
|
|
+ $scope.qute = function (remind) {
|
|
|
+ $http({
|
|
|
+ method: 'get',
|
|
|
+ dataType: 'json',
|
|
|
+ url: $scope.url + '/inquiry/sale/quote',
|
|
|
+ params: {id: remind.itemId, en_uu: $scope.currentEn.uu}
|
|
|
+ }).success(function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ if (response.inquiry != null) {
|
|
|
+ toaster.pop('error', '该单据已报价');
|
|
|
+ } else {
|
|
|
+ $http({
|
|
|
+ method: 'get',
|
|
|
+ dataType: 'json',
|
|
|
+ url: $scope.url + '/inquiry/public/findItemByItemId',
|
|
|
+ params: {itemId: remind.itemId, enuu: $scope.currentEn.uu}
|
|
|
+ }).success(function (response) {
|
|
|
+ var inquiryItem = response;
|
|
|
+ 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 () {
|
|
|
+
|
|
|
+ });
|
|
|
+ }).error(function (error) {
|
|
|
+ toaster.pop('error', '数据加载失败', error);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).error(function (err) {
|
|
|
+ toaster.pop('error', '数据加载失败', err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 跳转详情
|
|
|
+ $scope.remindDetail = function(remind) {
|
|
|
+ if (remind.newId == null) {
|
|
|
+ window.location.hash = '#/baseInfo/inquiryList/' + remind.itemId;
|
|
|
+ } else {
|
|
|
+ window.open("#/sale/pubinquiry/" + remind.newId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 搜索框回车
|
|
|
$scope.onSearch = function () {
|
|
|
$scope.tableParams.page(1);
|
|
|
@@ -24391,20 +24472,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.tableParams.reload();
|
|
|
}
|
|
|
|
|
|
- // 是否已过期
|
|
|
- $scope.isOverDue = function (date) {
|
|
|
- if (date) {
|
|
|
- var timestamp = new Date().getTime() + 60000;
|
|
|
- if (date > timestamp) {
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
// 转客户询价
|
|
|
$scope.qute = function (remind) {
|
|
|
$http({
|