|
|
|
@ -11,14 +11,16 @@
|
|
|
|
|
app.controller('customCtrl', ['$scope', '$http', 'commonDialog','$filter','$uibModal', function ($scope, $http, commonDialog,$filter,$uibModal) {
|
|
|
|
|
$scope.pagination = {};
|
|
|
|
|
$scope.customOrders = {};
|
|
|
|
|
$scope.params = {channel:'ALL'};
|
|
|
|
|
$scope.params = {channel:'ALL',report_status:'ALL'};
|
|
|
|
|
$scope.loadList = function () {
|
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
|
if (params.channel =='ALL'){
|
|
|
|
|
delete params.channel;
|
|
|
|
|
}
|
|
|
|
|
if (params.report_status =='ALL'){
|
|
|
|
|
delete params.report_status;
|
|
|
|
|
}
|
|
|
|
|
params.page = $scope.pagination.page || 1;
|
|
|
|
|
console.log(params);
|
|
|
|
|
$http.get('/custom/query',{params: params}).then(function (resp) {
|
|
|
|
|
$scope.customOrders = resp.data.data;
|
|
|
|
|
$scope.pagination = resp.data.pagination;
|
|
|
|
@ -26,24 +28,62 @@
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.loadList(1);
|
|
|
|
|
$scope.add = function (order_id) {
|
|
|
|
|
$scope.add = function (order) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/payment/custom/templates/custom_add.html',
|
|
|
|
|
controller: 'customAddCtrl',
|
|
|
|
|
size: 'lg',
|
|
|
|
|
resolve: {
|
|
|
|
|
order_id: function () {
|
|
|
|
|
return order_id;
|
|
|
|
|
}
|
|
|
|
|
return order.order_id;
|
|
|
|
|
},
|
|
|
|
|
channelCustom:['$http', '$stateParams', function ($http, $stateParams) {
|
|
|
|
|
return $http.get('/custom/channelCustom?channel='+order.channel);
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.edit = function (order) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/payment/custom/templates/custom_add.html',
|
|
|
|
|
controller: 'customEditCtrl',
|
|
|
|
|
size: 'lg',
|
|
|
|
|
resolve: {
|
|
|
|
|
customOrder: ['$http', '$stateParams', function ($http, $stateParams) {
|
|
|
|
|
return $http.get('/custom/'+order.report_id);
|
|
|
|
|
}],
|
|
|
|
|
order_id: function () {
|
|
|
|
|
return order.order_id;
|
|
|
|
|
},
|
|
|
|
|
channelCustom:['$http', '$stateParams', function ($http, $stateParams) {
|
|
|
|
|
return $http.get('/custom/channelCustom?channel='+order.channel);
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$scope.detail = function (order) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/payment/custom/templates/custom_detail.html',
|
|
|
|
|
controller: 'customDetailCtrl',
|
|
|
|
|
size: 'lg',
|
|
|
|
|
resolve: {
|
|
|
|
|
customOrder: ['$http', '$stateParams', function ($http, $stateParams) {
|
|
|
|
|
return $http.get('/custom/'+order.report_id);
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('customAddCtrl', ['$scope', '$http','commonDialog','order_id', function ($scope, $http,commonDialog,order_id) {
|
|
|
|
|
$scope.custom = {has_sub:false,order_id:order_id};
|
|
|
|
|
app.controller('customAddCtrl', ['$scope', '$http','commonDialog','order_id','channelCustom', function ($scope, $http,commonDialog,order_id,channelCustom) {
|
|
|
|
|
$scope.custom = {has_sub:false,order_id:order_id,isSubmit:true};
|
|
|
|
|
$scope.subOrders = new Array();
|
|
|
|
|
$scope.subOrder = {};
|
|
|
|
|
$scope.channelCustom = channelCustom.data;
|
|
|
|
|
$scope.addSubOrders = function () {
|
|
|
|
|
var subOrder = angular.copy($scope.subOrder);
|
|
|
|
|
subOrder.idNum = $scope.subOrders.length+1;
|
|
|
|
@ -73,15 +113,69 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('customEditCtrl', ['$scope', '$http','commonDialog','order_id','customOrder','channelCustom', function ($scope, $http,commonDialog,order_id,customOrder,channelCustom) {
|
|
|
|
|
$scope.custom =customOrder.data;
|
|
|
|
|
$scope.custom.has_sub = false;
|
|
|
|
|
$scope.custom.order_id = order_id;
|
|
|
|
|
$scope.custom.isSubmit = false;
|
|
|
|
|
$scope.subOrders = customOrder.data.sub_orders;
|
|
|
|
|
$scope.subOrder = {};
|
|
|
|
|
$scope.channelCustom = channelCustom.data;
|
|
|
|
|
if($scope.subOrders.length>0) {
|
|
|
|
|
for (var i = 0; i < $scope.subOrders.length; i++) {
|
|
|
|
|
var idNum = i;
|
|
|
|
|
$scope.subOrders[i].idNum = idNum;
|
|
|
|
|
}
|
|
|
|
|
$scope.custom.has_sub = true;
|
|
|
|
|
}else{
|
|
|
|
|
$scope.custom.has_sub = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$scope.addSubOrders = function () {
|
|
|
|
|
var subOrder = angular.copy($scope.subOrder);
|
|
|
|
|
subOrder.idNum = $scope.subOrders.length+1;
|
|
|
|
|
$scope.subOrders.push(subOrder);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
$scope.submit=function () {
|
|
|
|
|
if($scope.custom.custom==''){
|
|
|
|
|
alert('请输入海关名称');
|
|
|
|
|
}
|
|
|
|
|
if($scope.custom.mchCustomId==''){
|
|
|
|
|
alert('请输入备案号');
|
|
|
|
|
}
|
|
|
|
|
$scope.custom.subOrders = $scope.subOrders;
|
|
|
|
|
var param = angular.copy($scope.custom);
|
|
|
|
|
$http.post('/custom', param).then(function (resp) {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
$scope.removeSubOrders = function (order) {
|
|
|
|
|
for(var i= 0 ;i<$scope.subOrders.length;i++){
|
|
|
|
|
if($scope.subOrders[i].idNum == order.idNum){
|
|
|
|
|
$scope.subOrders.splice(i,1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.controller('customDetailCtrl', ['$scope', '$http','commonDialog', function ($scope, $http,commonDialog) {
|
|
|
|
|
$scope.subOrders = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('customDetailCtrl', ['$scope', '$http','commonDialog','customOrder', function ($scope, $http,commonDialog,customOrder) {
|
|
|
|
|
$scope.custom = customOrder.data;
|
|
|
|
|
if(customOrder.data.sub_orders.length>0){
|
|
|
|
|
$scope.custom.has_sub = true;
|
|
|
|
|
$scope.subOrders = $scope.custom.sub_orders;
|
|
|
|
|
}else {
|
|
|
|
|
$scope.custom.has_sub = false;
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|