|
|
@@ -262,7 +262,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/PurcOrder',
|
|
|
}
|
|
|
};
|
|
|
});
|
|
|
- app.controller('SaleOrderCtrl', function($scope, $filter, PurcOrderItem, ngTableParams){
|
|
|
+ app.controller('SaleOrderCtrl', function($scope, $filter, PurcOrderItem, ngTableParams, $modal){
|
|
|
var isNumber = function(n) {
|
|
|
return !isNaN(parseFloat(n)) && isFinite(n);
|
|
|
};
|
|
|
@@ -316,6 +316,22 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/PurcOrder',
|
|
|
return sum;
|
|
|
};
|
|
|
|
|
|
+ $scope.onReplyClick = function(order, orderItem) {
|
|
|
+ $modal.open({
|
|
|
+ templateUrl : 'sale/orders/items/reply.html',
|
|
|
+ controller : 'ReplyCtrl',
|
|
|
+ backdrop : "static",
|
|
|
+ resolve : {
|
|
|
+ order : function() {
|
|
|
+ return order;
|
|
|
+ },
|
|
|
+ orderItem: function() {
|
|
|
+ return orderItem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
$scope.reply = function(item) {
|
|
|
if(item.reply) {
|
|
|
var reply = angular.copy(item.reply),
|
|
|
@@ -330,5 +346,9 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/PurcOrder',
|
|
|
}
|
|
|
};
|
|
|
});
|
|
|
+ app.controller('ReplyCtrl', function($scope, $modalInstance, order, orderItem){
|
|
|
+ $scope.order = order;
|
|
|
+ $scope.orderItem = orderItem;
|
|
|
+ });
|
|
|
return app;
|
|
|
});
|