|
@@ -244,7 +244,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}).state('make.order_detail', {
|
|
}).state('make.order_detail', {
|
|
|
url : "/order/:id",
|
|
url : "/order/:id",
|
|
|
templateUrl : "static/tpl/index/make/order_detail.html",
|
|
templateUrl : "static/tpl/index/make/order_detail.html",
|
|
|
- controller: 'SaleOrderDetailCtrl'
|
|
|
|
|
|
|
+ controller: 'MakeOrderDetailCtrl'
|
|
|
}).state('make.change', {
|
|
}).state('make.change', {
|
|
|
url : "/change",
|
|
url : "/change",
|
|
|
templateUrl : "static/tpl/index/make/change.html",
|
|
templateUrl : "static/tpl/index/make/change.html",
|
|
@@ -3576,6 +3576,83 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
};
|
|
};
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 委外加工单详细
|
|
|
|
|
+ */
|
|
|
|
|
+ app.controller('MakeOrderDetailCtrl', ['$scope', '$stateParams', 'MakeOrder', 'toaster', 'ReportService', function($scope, $stateParams, MakeOrder, toaster, ReportService){
|
|
|
|
|
+ var loadData = function() {
|
|
|
|
|
+ MakeOrder.get({id: $stateParams.id}, function(data){
|
|
|
|
|
+ $scope.order = data;
|
|
|
|
|
+ console.log("$scope.order:" + $scope.order.qty +"$scope.order:" +$scope.order.price);
|
|
|
|
|
+ var sum = $scope.order.qty * $scope.order.price;
|
|
|
|
|
+ $scope.order.total = sum;
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ loadData();
|
|
|
|
|
+ // 获取回复记录
|
|
|
|
|
+ $scope.getReply = function(item) {
|
|
|
|
|
+ if(!item.replies) {
|
|
|
|
|
+ MakeOrder.getReply({orderId: item.id}, function(replies){
|
|
|
|
|
+ item.replies = replies;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 点击回复
|
|
|
|
|
+ $scope.onReplyClick = function(order, inverse) {
|
|
|
|
|
+ if(order.reply) {
|
|
|
|
|
+ if(!order.reply.qty || order.reply.qty < 0 || order.reply.qty > order.qty) {
|
|
|
|
|
+ toaster.pop('warning', '提示', '请填写有效的回复数量!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ var reply = angular.copy(order.reply);
|
|
|
|
|
+ if(reply.delivery) {
|
|
|
|
|
+ if(typeof reply.delivery == 'object')
|
|
|
|
|
+ reply.delivery = reply.delivery.getTime();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ reply.delivery = order.delivery;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(inverse && inverse == -1) reply.qty = -1 * reply.qty;// 取相反
|
|
|
|
|
+ $scope.loading = true;
|
|
|
|
|
+ MakeOrder.reply({orderId: order.id}, reply, function(){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ toaster.pop('info', '提示', (inverse == -1 ? '撤销成功':'回复成功'));
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ }, function(response){
|
|
|
|
|
+ $scope.loading = false;
|
|
|
|
|
+ toaster.pop('error', '回复失败', response.data);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 打开回复
|
|
|
|
|
+ $scope.openReply = function(order) {
|
|
|
|
|
+ if(!order.reply) {
|
|
|
|
|
+ order.reply = {
|
|
|
|
|
+ qty: order.qty - (order.replyQty ? order.replyQty : 0),
|
|
|
|
|
+ delivery: order.delivery
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ order.$editing = true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 关闭回复
|
|
|
|
|
+ $scope.closeReply = function(order) {
|
|
|
|
|
+ order.$editing = false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $scope.print = function(order) {
|
|
|
|
|
+ MakeOrder.printCount({id: order.id},{});//增加打印此次
|
|
|
|
|
+ ReportService.print(order.enUU, 'make', '{make_orders.ma_id}=' + order.id, ' 委外订单-' + order.code);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ }]);
|
|
|
/**
|
|
/**
|
|
|
* 客户委外验收
|
|
* 客户委外验收
|
|
|
*/
|
|
*/
|