|
|
@@ -4,13 +4,18 @@
|
|
|
*/
|
|
|
define(['app/app'], function (app) {
|
|
|
"use strict";
|
|
|
- app.register.controller('vendorOrderCtrl', ['$scope', '$rootScope', 'Purchase', 'ngTableParams', 'BaseService', 'toaster', '$state', '$filter', 'Return', 'Change', '$modal', 'PuExProcess', 'Recommendation', 'DateUtil', 'Loading', 'bankInfoService', 'Logistics', 'Distributor', function ($scope, $rootScope, Purchase, ngTableParams, BaseService, toaster, $state, $filter, Return, Change, $modal, PuExProcess, Recommendation, DateUtil, Loading, bankInfoService, Logistics, Distributor) {
|
|
|
+ app.register.controller('vendorOrderCtrl', ['$scope', '$rootScope', 'Purchase', 'ngTableParams', 'BaseService', 'toaster', '$state', '$filter', 'Return', 'Change', '$modal', 'PuExProcess', 'Recommendation', 'DateUtil', 'Loading', 'bankInfoService', 'Logistics', 'Distributor', 'SessionService', function ($scope, $rootScope, Purchase, ngTableParams, BaseService, toaster, $state, $filter, Return, Change, $modal, PuExProcess, Recommendation, DateUtil, Loading, bankInfoService, Logistics, Distributor, SessionService) {
|
|
|
$rootScope.active = 'vendor_order';
|
|
|
|
|
|
// 加密过滤器
|
|
|
var enIdFilter = $filter('EncryptionFilter');
|
|
|
// 默认状态为所有订单
|
|
|
- $scope.status = 'all';
|
|
|
+ if (SessionService.getCookie('status')){
|
|
|
+ $scope.status = SessionService.get('status');
|
|
|
+ SessionService.removeCookie('status');
|
|
|
+ }else {
|
|
|
+ $scope.status = 'all';
|
|
|
+ }
|
|
|
// 分页相关数据
|
|
|
$scope.pageParams = {number: 1};
|
|
|
// 下拉菜单状态
|
|
|
@@ -292,16 +297,33 @@ define(['app/app'], function (app) {
|
|
|
purchase.showLogistics = false;
|
|
|
}
|
|
|
})
|
|
|
+ }else {
|
|
|
+ purchase.showLogistics = false;
|
|
|
}
|
|
|
}else { //更新物流信息
|
|
|
- Logistics.updateLogistics({id : purchase.lgtId, invoiceFuid : purchase.inid}, $scope.logistics, function (data) {
|
|
|
- if (data){
|
|
|
- if(data.success){
|
|
|
- toaster.pop("success", "修改物流信息成功");
|
|
|
- purchase.showLogistics = false;
|
|
|
+ if ($scope.logistics.companyName && $scope.logistics.number){
|
|
|
+ Logistics.updateLogistics({id : purchase.lgtId, invoiceFuid : purchase.inid}, $scope.logistics, function (data) {
|
|
|
+ if (data){
|
|
|
+ if(data.success){
|
|
|
+ toaster.pop("success", "修改物流信息成功");
|
|
|
+ purchase.showLogistics = false;
|
|
|
+ }
|
|
|
}
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if (purchase.sendType != 1301){
|
|
|
+ //没有则删除快递信息
|
|
|
+ Logistics.clearLogistics({inid : purchase.inid}, {}, function (data) {
|
|
|
+ if (data){
|
|
|
+ if(data.success){
|
|
|
+ $scope.orderTableParams.reload();
|
|
|
+ toaster.pop("success", "修改物流信息成功");
|
|
|
+ purchase.showLogistics = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|