|
@@ -337,6 +337,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
url: "/pubinquiry/:id",
|
|
url: "/pubinquiry/:id",
|
|
|
templateUrl: "static/tpl/index/sale/pubinquiry_detail.html",
|
|
templateUrl: "static/tpl/index/sale/pubinquiry_detail.html",
|
|
|
controller: 'SalePubInquiryDetailCtrl'
|
|
controller: 'SalePubInquiryDetailCtrl'
|
|
|
|
|
+ }).state('sale.inquiryRemind', {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 针对卖家,查询推荐的询价列表
|
|
|
|
|
+ */
|
|
|
|
|
+ url: "/inquiryRemind",
|
|
|
|
|
+ templateUrl: "static/tpl/index/sale/inquiryRemind.html",
|
|
|
|
|
+ controller: 'SaleInquiryRemindCtrl'
|
|
|
}).state('sale.inquirymould', {
|
|
}).state('sale.inquirymould', {
|
|
|
url: "/mould",
|
|
url: "/mould",
|
|
|
templateUrl: "static/tpl/index/sale/inquiry_mould.html",
|
|
templateUrl: "static/tpl/index/sale/inquiry_mould.html",
|
|
@@ -23801,7 +23808,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.active = $rootScope.active;
|
|
$scope.active = $rootScope.active;
|
|
|
$rootScope.active = null;
|
|
$rootScope.active = null;
|
|
|
} else {
|
|
} else {
|
|
|
- $scope.active = 'todo';
|
|
|
|
|
|
|
+ $scope.active = 'all';
|
|
|
}
|
|
}
|
|
|
$scope.agreedText = '全部';
|
|
$scope.agreedText = '全部';
|
|
|
$scope.dateZoneText = '最近一个月';
|
|
$scope.dateZoneText = '最近一个月';
|
|
@@ -24175,5 +24182,181 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
});
|
|
});
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 针对卖家,询价推荐列表
|
|
|
|
|
+ */
|
|
|
|
|
+ app.controller('SaleInquiryRemindCtrl', ['$scope', '$filter', 'ngTableParams', 'toaster', 'BaseService', 'publicInquiry', '$modal', 'AccountEnterprise', '$http', 'AuthenticationService', function ($scope, $filter, ngTableParams, toaster, BaseService, publicInquiry, $modal, AccountEnterprise, $http, AuthenticationService) {
|
|
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
|
|
+ $scope.agreedText = '全部';
|
|
|
|
|
+ $scope.dateZoneText = '最近一个月';
|
|
|
|
|
+ $scope.condition = {dateZone: 1};
|
|
|
|
|
+
|
|
|
|
|
+ /* 时间筛选初始化*/
|
|
|
|
|
+ var fromDate = new Date();
|
|
|
|
|
+ var toDate = new Date();
|
|
|
|
|
+ fromDate.setMonth(fromDate.getMonth() - 1);
|
|
|
|
|
+ fromDate.setHours(0, 0, 0, 0);
|
|
|
|
|
+ toDate.setHours(23, 59, 59, 999);
|
|
|
|
|
+ $scope.condition.dateFrom = fromDate;
|
|
|
|
|
+ $scope.condition.dateTo = toDate;
|
|
|
|
|
+
|
|
|
|
|
+ $scope.changeDateZone = function (zone) {
|
|
|
|
|
+ $scope.condition.dateZone = zone;
|
|
|
|
|
+ $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 3 ? '最近六个月' : '自定义'));
|
|
|
|
|
+ $scope.condition.$dateZoneOpen = false;
|
|
|
|
|
+ getDateCondition(zone, $scope.condition);
|
|
|
|
|
+ $scope.tableParams.page(1);
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ count: 20,
|
|
|
|
|
+ sorting: {
|
|
|
|
|
+ 'date': '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)
|
|
|
|
|
+ };
|
|
|
|
|
+ if ($scope.active == 'overdue') {
|
|
|
|
|
+ $scope.active = 'end';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ AccountEnterprise.get({}, function(data) {
|
|
|
|
|
+ $scope.currentEn = data;
|
|
|
|
|
+ publicInquiry.getUrl({}, function(data) {
|
|
|
|
|
+ $scope.url = data.url;
|
|
|
|
|
+ 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);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $scope.getMinDate = function (item) {
|
|
|
|
|
+ return $filter('date')(item.inquiry.date, 'yyyy-MM-dd');
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.openDatePicker = function ($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.openFilterDatePicker = function ($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 搜索框回车
|
|
|
|
|
+ $scope.onSearch = function (keyword) {
|
|
|
|
|
+ // 每次搜索重置获取数据方法
|
|
|
|
|
+ $scope.searchMethod = false;
|
|
|
|
|
+ if(keyword != null && keyword != '') {
|
|
|
|
|
+ $scope.searchMethod = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ $scope.tableParams.page(1);
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 取消
|
|
|
|
|
+ $scope.cancel = function () {
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 是否已过期
|
|
|
|
|
+ $scope.isOverDue = function (date) {
|
|
|
|
|
+ if (date) {
|
|
|
|
|
+ var ndate = new Date();
|
|
|
|
|
+ ndate.setHours(23, 59, 59 ,999);
|
|
|
|
|
+ ndate.setDate(ndate.getDate());
|
|
|
|
|
+ var timestamp = Date.parse(ndate);
|
|
|
|
|
+ if (date > timestamp) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 转客户询价
|
|
|
|
|
+ $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/sale/quote',
|
|
|
|
|
+ params: {id: remind.itemId, en_uu: $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);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }]);
|
|
|
|
|
+
|
|
|
return app;
|
|
return app;
|
|
|
});
|
|
});
|