|
|
@@ -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'], 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'], 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']);
|
|
|
+ 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']);
|
|
|
app.init = function () {
|
|
|
angular.bootstrap(document, ['myApp']);
|
|
|
};
|
|
|
@@ -2840,14 +2840,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
}]);
|
|
|
|
|
|
- app.controller('SaleOrderCtrl', ['$scope', '$filter', 'PurcOrderItem', 'PurcOrder', 'ngTableParams', 'toaster', 'ReportService', 'BaseService', 'PurcOrderItemHis', 'PagingRelease', 'SnapshotService', 'PurcOrderItemInfo', function ($scope, $filter, PurcOrderItem, PurcOrder, ngTableParams, toaster, ReportService, BaseService, PurcOrderItemHis, PagingRelease, SnapshotService, PurcOrderItemInfo) {
|
|
|
+ app.controller('SaleOrderCtrl', ['$scope', '$filter', 'PurcOrderItem', 'PurcOrder', 'ngTableParams', 'toaster', 'ReportService', 'BaseService', 'PurcOrderItemHis', 'PagingRelease', 'SnapshotService', 'PurcOrderItemInfo', 'token', function ($scope, $filter, PurcOrderItem, PurcOrder, ngTableParams, toaster, ReportService, BaseService, PurcOrderItemHis, PagingRelease, SnapshotService, PurcOrderItemInfo, token) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
|
|
|
$scope.active = 'todo';
|
|
|
$scope.dateZoneText = '不限';
|
|
|
$scope.deliveryZoneText = '不限';
|
|
|
$scope.condition = {dateZone: 1, deliveryZone: -1};
|
|
|
-
|
|
|
/* 时间筛选初始化*/
|
|
|
var fromDate = new Date();
|
|
|
var toDate = new Date();
|
|
|
@@ -2911,7 +2910,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
$scope.loading = false;
|
|
|
if (page) {
|
|
|
-
|
|
|
+ console.log(page);
|
|
|
//获取每个明细单最新回复数
|
|
|
angular.forEach(page.content, function(order){
|
|
|
angular.forEach(order.orderItems, function(item){
|
|
|
@@ -2920,7 +2919,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
$defer.resolve(page.content);
|
|
|
params.total(page.totalElement);
|
|
|
$scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的条件
|
|
|
@@ -3013,6 +3011,17 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
return new Date();
|
|
|
};
|
|
|
|
|
|
+ // 获取token信息
|
|
|
+ $scope.getToken = function() {
|
|
|
+ if($scope.token == null) {
|
|
|
+ token.info({userType: 'sale'}, {}, function(data) {
|
|
|
+ $scope.token = data.token;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$scope.onReplyClick = function (item, inverse) {
|
|
|
if (item.reply) {
|
|
|
if (!item.reply.qty || item.reply.qty < 0 || item.reply.qty > item.qty) {
|
|
|
@@ -3028,7 +3037,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
if (inverse && inverse == -1) reply.qty = -1 * reply.qty;// 取相反
|
|
|
$scope.loading = true;
|
|
|
- PurcOrderItem.reply({orderItemId: item.id}, reply, function () {
|
|
|
+ PurcOrderItem.reply({orderItemId: item.id, token: $scope.token}, reply, function () {
|
|
|
$scope.loading = false;
|
|
|
toaster.pop('info', '提示', (inverse == -1 ? '撤销成功' : '回复成功'));
|
|
|
$scope.tableParams.reload();
|
|
|
@@ -15139,6 +15148,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
getSerivce();
|
|
|
|
|
|
+ // 获取订单总金额
|
|
|
+ var getOrdersAmount = function() {
|
|
|
+ DeputyOrder.odersAmount({}, function(data) {
|
|
|
+ $scope.odersAmount = data.amount;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ getOrdersAmount();
|
|
|
+
|
|
|
$scope.tableParams = new ngTableParams({
|
|
|
page: 1,
|
|
|
count: 20,
|