|
|
@@ -1,14 +1,14 @@
|
|
|
|
|
|
define(['app/app'], function(app) {
|
|
|
"use strict";
|
|
|
- app.register.controller('orderDetailCtrl', ['$scope', 'Order', 'Logistics', 'ComponentActive', 'toaster', '$stateParams', 'KdnLogistics', '$state', 'StoreInfo', 'NumberService', '$location', function($scope, Order, Logistics, ComponentActive, toaster, $stateParams, KdnLogistics, $state, StoreInfo, NumberService, $location) {
|
|
|
+ app.register.controller('orderDetailCtrl', ['$scope', 'Order', 'Logistics', 'ComponentActive', 'toaster', '$stateParams', 'KdnLogistics', '$state', 'StoreInfo', 'NumberService', '$location', 'OrderSimpleInfo',function($scope, Order, Logistics, ComponentActive, toaster, $stateParams, KdnLogistics, $state, StoreInfo, NumberService, $location, OrderSimpleInfo) {
|
|
|
|
|
|
document.title = '订单详情-优软商城';
|
|
|
// 保存订单编号信息
|
|
|
$scope.orderId = $stateParams.orderid;
|
|
|
- $scope.acceptGoods = $location.search().fromPage || false // 是否是 收货入库进来
|
|
|
+ $scope.acceptGoods = false // 是否是 收货入库进来
|
|
|
$scope.CheckId = 'autoMonth0' // 当前发货点选择按钮
|
|
|
- $scope.ChooseItem = {} // 当前选择发货单
|
|
|
+ $scope.ChooseItem = '' // 当前选择发货单
|
|
|
|
|
|
// 记录状态激活信息
|
|
|
$scope.steps = {
|
|
|
@@ -196,6 +196,9 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
|
$scope.order = data;
|
|
|
$scope.sendGoodsList = $scope.order.inIds.split(',')
|
|
|
+ $scope.ChooseItem = $scope.sendGoodsList.length > 0 ? $scope.sendGoodsList[0] : ''
|
|
|
+ // todo 这里需要根据 是否存在已收货数据
|
|
|
+ $scope.acceptGoods = ($scope.sendGoodsList.length > 0 && ) ? true : false
|
|
|
$scope.order.orderHistory = angular.fromJson($scope.order.statushistory);
|
|
|
if ($scope.order.orderRemark){
|
|
|
$scope.remarkList = angular.fromJson($scope.order.orderRemark);
|
|
|
@@ -256,12 +259,21 @@ define(['app/app'], function(app) {
|
|
|
$scope.ensureAccept = function() {
|
|
|
// var orderids = Object.getOwnPropertyNames($scope.store);
|
|
|
var ids = $scope.order.id
|
|
|
- OrderSimpleInfo.ensureAccept({ids: ids},{invoiceId: $scope.ChooseItem},function(data){
|
|
|
- toaster.pop('success', '成功' ,'确认收货成功');
|
|
|
- $scope.goBack()
|
|
|
- }, function(res){
|
|
|
- toaster.pop('error', '失败!' + res.data);
|
|
|
- });
|
|
|
+ if ($scope.ChooseItem === '') {
|
|
|
+ OrderSimpleInfo.mutilpEnsureAccept({id: ids},{},function(data){
|
|
|
+ toaster.pop('success', '成功' ,'确认收货成功');
|
|
|
+ $scope.goBack()
|
|
|
+ }, function(res){
|
|
|
+ toaster.pop('error', '失败!' + res.data);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ OrderSimpleInfo.mutilpEnsureAccept({id: ids, invoiceId: $scope.ChooseItem},{},function(data){
|
|
|
+ toaster.pop('success', '成功' ,'确认收货成功');
|
|
|
+ $scope.goBack()
|
|
|
+ }, function(res){
|
|
|
+ toaster.pop('error', '失败!' + res.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// 取消收货
|