|
@@ -4,7 +4,7 @@
|
|
|
*/
|
|
*/
|
|
|
define(['app/app'], function (app) {
|
|
define(['app/app'], function (app) {
|
|
|
"use strict";
|
|
"use strict";
|
|
|
- app.register.controller('vendorOrderCtrl', ['$scope', '$rootScope', 'Purchase', 'ngTableParams', 'BaseService', 'toaster', '$state', '$filter', 'Return', 'Change', '$modal', 'PuExProcess', 'Recommendation', 'DateUtil', 'Loading', 'bankInfoService', function ($scope, $rootScope, Purchase, ngTableParams, BaseService, toaster, $state, $filter, Return, Change, $modal, PuExProcess, Recommendation, DateUtil, Loading, bankInfoService) {
|
|
|
|
|
|
|
+ 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) {
|
|
|
$rootScope.active = 'vendor_order';
|
|
$rootScope.active = 'vendor_order';
|
|
|
|
|
|
|
|
// 加密过滤器
|
|
// 加密过滤器
|
|
@@ -169,6 +169,53 @@ define(['app/app'], function (app) {
|
|
|
state: 'orderBycreatetimeDesc'
|
|
state: 'orderBycreatetimeDesc'
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ $scope.findSelectedDistributor = function () {
|
|
|
|
|
+ Distributor.findAllSelected({},{},function (data) {
|
|
|
|
|
+ if (data){
|
|
|
|
|
+ $scope.companyList = data;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.findSelectedDistributor();
|
|
|
|
|
+
|
|
|
|
|
+ //配送方式类型
|
|
|
|
|
+ $scope.deliveryMethod = {
|
|
|
|
|
+ 1301: '第三方配送',
|
|
|
|
|
+ 1302: '卖家配送',
|
|
|
|
|
+ 1303: '上门自提'
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.modifyLogistic = function (purchase) {
|
|
|
|
|
+ purchase.showLogistics = !purchase.showLogistics;
|
|
|
|
|
+ angular.forEach($scope.purchases, function (data) {
|
|
|
|
|
+ if (data.id != purchase.id){
|
|
|
|
|
+ data.showLogistics = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ if (purchase.showLogistics){
|
|
|
|
|
+ Logistics.findLogisticsById({lgtid:purchase.lgtId}, {}, function (data) {
|
|
|
|
|
+ if (data){
|
|
|
|
|
+ $scope.logistics = data;
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log($scope.logistics);
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.cancelModify = function (purchase) {
|
|
|
|
|
+ purchase.showLogistics = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.ensureModifyLogistics = function (purchase) {
|
|
|
|
|
+ Logistics.updateLogistics({id : purchase.lgtId, invoiceFuid : purchase.inid}, $scope.logistics, function (data) {
|
|
|
|
|
+ if (data){
|
|
|
|
|
+ if(data.success){
|
|
|
|
|
+ toaster.pop("info", "修改物流信息成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
$scope.changeOrderState = function (state) {
|
|
$scope.changeOrderState = function (state) {
|
|
|
if ($scope.sortingState.state === state) {
|
|
if ($scope.sortingState.state === state) {
|
|
|
$scope.orderTableParams.sorting({createtime: 'DESC'});
|
|
$scope.orderTableParams.sorting({createtime: 'DESC'});
|