AccountOrderCheckingDetailController.js
6.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
"use strict";
var AccountOrderCheckingDetailController = angular.module('AccountOrderCheckingDetailController',[]);
//获取订单列表
AccountOrderCheckingDetailController.controller('AccountOrderCheckingDetailController', [
'$rootScope',
'$scope',
'AccountOrderCheckingDetailService',
'SystemUserService',
'SupplierService',
function($rootScope, $scope, AccountOrderCheckingDetailService, SystemUserService,SupplierService) {
var orderFrom = $rootScope.$stateParams.orderFrom;
var orderStatus = $rootScope.$stateParams.orderStatus;
var erpImport = $rootScope.$stateParams.erpImport;
var orderCheckingId = $rootScope.$stateParams.orderCheckingId;
$scope.suppliersFlag = 0;
$scope.suppliers = [];
$scope.orders = [];
$scope.currentPage = 1;
$scope.pageSize = 20;
$scope.numPages = 1;
$scope.totalRecord = 0;
$scope.pages = [];
$scope.choseAtrr = [];
$scope.master = false;
$scope.orderQuery = {
orderCode: '',
orderFrom: '',
startCreateDt: '',
endCreateDt: '',
supplierId: '',
phone: '',
orderStatus: '',
buyerUsername: '',
buyerPhone: '',
erpImport: '',
pageNow: 1,
pageSize: 20,
orderCheckingId: '',
};
$scope.orderQuery.orderCheckingId = orderCheckingId;
if (orderStatus > 0 || orderStatus != -1) {
$scope.orderQuery.orderStatus = orderStatus;
}
if (erpImport) {
$scope.orderQuery.erpImport = erpImport;
}
//获取商家列表
SupplierService.listSupplier();
$scope.$on('supplier.list', function () {
$scope.suppliers = SupplierService.suppliers;
});
//获取当前用户信息
SystemUserService.getCuurentUserinfo();
$scope.$on('current.userinfo', function () {
$scope.userinfo = SystemUserService.userinfo;
if (SystemUserService.userinfo.platformFlag == false) {
$scope.suppliersFlag = 1;
}
});
//获取订单状态信息
AccountOrderCheckingDetailService.statusList(orderFrom);
$scope.$on('orders.orderStatusList', function () {
$scope.orderStatus = AccountOrderCheckingDetailService.orderStatusList;
});
//获取订单列表
$scope.orderQuery.orderFrom = orderFrom;
if ($scope.orderQuery.orderStatus != null && $scope.orderQuery.orderStatus != '') {
AccountOrderCheckingDetailService.orderPagerList($scope.orderQuery);
}
$scope.$on('orders.list', function () {
$scope.orders = AccountOrderCheckingDetailService.orders;
$scope.numPages = AccountOrderCheckingDetailService.orders.totalPage;
$scope.totalRecord = AccountOrderCheckingDetailService.orders.totalRecord;
});
//导出表格
$scope.exportProductExcel = function () {
$scope.orderQuery.startCreateDt = $('#datepickfrom').val();
$scope.orderQuery.endCreateDt = $('#datepickto').val();
if ($scope.orderQuery.orderStatus != null && $scope.orderQuery.orderStatus != '') {
if ($scope.orderQuery.startCreateDt == '') {
if (confirm("小主,你没有选择开始时间,导出数据很多,请耐心等待...")) {
window.open("../templateAccountOrder/exportAccountOrderCheckingExcel?orderCode=" + $scope.orderQuery.orderCode +
"&orderFrom=" + $scope.orderQuery.orderFrom + "&orderCheckingId=" + orderCheckingId +"&startCreateDt=" + $scope.orderQuery.startCreateDt +
"&endCreateDt=" + $scope.orderQuery.endCreateDt + "&phone=" + $scope.orderQuery.phone + "&orderStatus=" + $scope.orderQuery.orderStatus
+ "&buyerUsername=" + $scope.orderQuery.buyerUsername + "&buyerPhone=" + $scope.orderQuery.buyerPhone + "&erpImport="
+ $scope.orderQuery.erpImport + "&supplierId=" + $scope.orderQuery.supplierId);
}
} else {
window.open("../templateAccountOrder/exportAccountOrderCheckingExcel?orderCode=" + $scope.orderQuery.orderCode +
"&orderFrom=" + $scope.orderQuery.orderFrom + "&startCreateDt=" + $scope.orderQuery.startCreateDt +
"&endCreateDt=" + $scope.orderQuery.endCreateDt + "&phone=" + $scope.orderQuery.phone + "&orderStatus=" + $scope.orderQuery.orderStatus
+ "&buyerUsername=" + $scope.orderQuery.buyerUsername + "&buyerPhone=" + $scope.orderQuery.buyerPhone + "&erpImport="
+ $scope.orderQuery.erpImport + "&supplierId=" + $scope.orderQuery.supplierId);
}
} else {
alert("请选择订单状态!");
}
};
//选当前页
$scope.onSelectPage = function (page) {
$scope.orderQuery.pageNow = page;
$scope.currentPage = page;
AccountOrderCheckingDetailService.orderPagerList($scope.orderQuery);
};
AccountOrderCheckingDetailService.orderPagerList($scope.orderQuery);
$scope.searchOrder = function () {
$scope.orderQuery.pageNow = 1;
$scope.orderQuery.startCreateDt = $('#datepickfrom').val();
$scope.orderQuery.endCreateDt = $('#datepickto').val();
AccountOrderCheckingDetailService.orderPagerList($scope.orderQuery);
};
}
]);
//获取订单详情
AccountOrderCheckingDetailController.controller("AccountOrderCheckingContentController",[
'$rootScope',
'$scope',
'AccountOrderCheckingDetailService',
function($rootScope, $scope, AccountOrderCheckingDetailService) {
var orderCode=$rootScope.$stateParams.orderCode;
$scope.orderFrom=$rootScope.$stateParams.orderFrom;
AccountOrderCheckingDetailService.orderDetail(orderCode);
$scope.$on('orders.detail', function(){
$scope.orderDetailBean = AccountOrderCheckingDetailService.orderDetailBean;
});
}
]);