|
@@ -12787,7 +12787,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.deOrder.legalrepresent = data.legalrepresent;
|
|
$scope.deOrder.legalrepresent = data.legalrepresent;
|
|
|
$scope.deOrder.tervendaddress = data.tervendaddress;
|
|
$scope.deOrder.tervendaddress = data.tervendaddress;
|
|
|
$scope.deOrder.enfax = data.enfax;
|
|
$scope.deOrder.enfax = data.enfax;
|
|
|
- $scope.deOrder.deliverymethod = data.getDeliverymethod;
|
|
|
|
|
|
|
+ $scope.deOrder.deliverymethod = data.deliverymethod;
|
|
|
}, function(response) {
|
|
}, function(response) {
|
|
|
toaster.pop('error', '提示', response.data);
|
|
toaster.pop('error', '提示', response.data);
|
|
|
});
|
|
});
|
|
@@ -12913,63 +12913,160 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- // 保存
|
|
|
|
|
- $scope.save = function() {
|
|
|
|
|
- $scope.deOrder.entrystatus = '保存';
|
|
|
|
|
- $scope.deOrder.totalamount = 0;
|
|
|
|
|
- $scope.deOrder.usdpayment = 0;
|
|
|
|
|
- $scope.deOrder.orderamount = 0;
|
|
|
|
|
- $scope.deOrder.totalpayament = 0;
|
|
|
|
|
- angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
|
|
- $scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
|
|
- });
|
|
|
|
|
- if($scope.deOrder.deputyOrderItems[0].prodcode == null) {
|
|
|
|
|
- toaster.pop('info', '提示', '您还未填写任何商品信息');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $scope.checkresult = false;
|
|
|
|
|
+ var checkKeyword = function() {
|
|
|
|
|
+ if($scope.deOrder.madealdate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '主协议签订日期未选择');
|
|
|
|
|
+ } else if($scope.deOrder.madealcode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '主协议签订编号未填写');
|
|
|
|
|
+ } else if ($scope.deOrder.tervendor == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '终端供应商名称未填写');
|
|
|
|
|
+ } else if($scope.deOrder.vendtel == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '电话号码未填写');
|
|
|
|
|
+ } else if($scope.deOrder.venduser == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '联系人未填写');
|
|
|
|
|
+ } else if($scope.deOrder.shipdate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '供应商发货时间未选择');
|
|
|
|
|
+ } else if($scope.deOrder.goodspacking == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '货物包装要求未填写');
|
|
|
|
|
+ } else if($scope.deOrder.deliverymethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '供应商交货方式未填写');
|
|
|
|
|
+ } else if($scope.deOrder.pickupmethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '我方提货方式未填写');
|
|
|
|
|
+ } else if($scope.deOrder.paymentmethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '我方付款方式未填写');
|
|
|
|
|
+ } else if($scope.deOrder.pickupdate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '我方提货时间未选择');
|
|
|
|
|
+ } else if($scope.deOrder.currency == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '交易币别未选择');
|
|
|
|
|
+ } else if($scope.deOrder.deputyuu == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '代采企业未选择');
|
|
|
|
|
+ } else if($scope.deOrder.salecode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单编号未填写');
|
|
|
|
|
+ } else if($scope.deOrder.paydeldate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '我方付款提货时间未选择');
|
|
|
|
|
+ } else if($scope.deOrder.riskmethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '风险承担方式未填写');
|
|
|
|
|
+ } else if($scope.deOrder.taxpaymentmethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '运、税费承担方式');
|
|
|
|
|
+ } else if($scope.deOrder.tervendaddress == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '终端供应商地址未填写');
|
|
|
|
|
+ } else if($scope.deOrder.companyname == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '公司全称(英文)未填写');
|
|
|
|
|
+ } else if($scope.deOrder.requirepaydate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '要求付汇日期未选择');
|
|
|
|
|
+ } else if($scope.deOrder.bankname == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '银行名称(英文)未填写');
|
|
|
|
|
+ } else if($scope.deOrder.bankaccount == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '银行账号未填写');
|
|
|
|
|
+ } else if($scope.deOrder.bankaddress == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '银行地址未填写');
|
|
|
|
|
+ } else if($scope.deOrder.bankcode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '银行代码未填写');
|
|
|
|
|
+ } else if($scope.deOrder.salepocode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '合同编号未填写');
|
|
|
|
|
+ } else if($scope.deOrder.legalrepresent == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '供应商方法定代表人未填写');
|
|
|
|
|
+ } else if($scope.deOrder.paycomname == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '付款公司未填写');
|
|
|
|
|
+ } else if($scope.deOrder.paycomaddress == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '付款公司地址未填写');
|
|
|
|
|
+ } else if($scope.deOrder.enfax == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '供应商方法人电话未填写');
|
|
|
|
|
+ } else if($scope.deOrder.paydate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '货款支付时间未选择');
|
|
|
|
|
+ } else if($scope.deOrder.paymethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '货款支付方式未填写');
|
|
|
|
|
+ } else if($scope.deOrder.deliverydate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '交货时间未选择');
|
|
|
} else {
|
|
} else {
|
|
|
- DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
|
|
|
- if(data.id) {
|
|
|
|
|
- toaster.pop('success', '提示', '保存成功');
|
|
|
|
|
- window.location.hash = "#/purc/deputy/"+data.id;
|
|
|
|
|
- }
|
|
|
|
|
- if(data.error) {
|
|
|
|
|
- toaster.pop('error', '提示', '保存失败');
|
|
|
|
|
|
|
+ angular.forEach($scope.deOrder.deputyOrderItems, function(orderitem, index) {
|
|
|
|
|
+ console.log(orderitem);
|
|
|
|
|
+ if(orderitem.prodname == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行产品名称未填写');
|
|
|
|
|
+ } else if(orderitem.prodcode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行产品编号未填写');
|
|
|
|
|
+ } else if(orderitem.prodspec == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行产品规格未填写');
|
|
|
|
|
+ } else if(orderitem.prodbrand == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行产品品牌未填写');
|
|
|
|
|
+ } else if(orderitem.amount == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行数量未填写');
|
|
|
|
|
+ } else if(orderitem.unitprice == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行单价未填写');
|
|
|
|
|
+ } else if(orderitem.purcprice == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行订单单价未填写');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $scope.checkresult = true;
|
|
|
}
|
|
}
|
|
|
- }, function(response) {
|
|
|
|
|
-
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 保存
|
|
|
|
|
+ $scope.save = function() {
|
|
|
|
|
+ checkKeyword();
|
|
|
|
|
+ if($scope.checkresult) {
|
|
|
|
|
+ $scope.deOrder.entrystatus = '保存';
|
|
|
|
|
+ $scope.deOrder.totalamount = 0;
|
|
|
|
|
+ $scope.deOrder.usdpayment = 0;
|
|
|
|
|
+ $scope.deOrder.orderamount = 0;
|
|
|
|
|
+ $scope.deOrder.totalpayament = 0;
|
|
|
|
|
+ angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
|
|
+ $scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
|
|
+ });
|
|
|
|
|
+ if($scope.deOrder.deputyOrderItems[0].prodcode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '您还未填写任何商品信息');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
|
|
|
+ if(data.id) {
|
|
|
|
|
+ toaster.pop('success', '提示', '保存成功');
|
|
|
|
|
+ window.location.hash = "#/purc/deputy/"+data.id;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(data.error) {
|
|
|
|
|
+ toaster.pop('error', '提示', '保存失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ }, function(response) {
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 提交
|
|
// 提交
|
|
|
$scope.submit = function() {
|
|
$scope.submit = function() {
|
|
|
- $scope.deOrder.entrystatus = '已提交';
|
|
|
|
|
- $scope.deOrder.totalamount = 0;
|
|
|
|
|
- $scope.deOrder.usdpayment = 0;
|
|
|
|
|
- $scope.deOrder.orderamount = 0;
|
|
|
|
|
- $scope.deOrder.totalpayament = 0;
|
|
|
|
|
- angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
|
|
- $scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
|
|
- });
|
|
|
|
|
- if($scope.deOrder.deputyOrderItems[0].prodcode == null) {
|
|
|
|
|
- toaster.pop('info', '提示', '您还未填写任何商品信息');
|
|
|
|
|
- } else {
|
|
|
|
|
- DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
|
|
|
- if(data.id) {
|
|
|
|
|
- toaster.pop('success', '提示', '提交成功');
|
|
|
|
|
- window.location.hash = "#/purc/deputy/"+data.id;
|
|
|
|
|
- }
|
|
|
|
|
- if(data.error) {
|
|
|
|
|
- toaster.pop('error', '提示', '保存失败');
|
|
|
|
|
- }
|
|
|
|
|
- }, function(response) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ var result = checkKeyword();
|
|
|
|
|
+ if(result) {
|
|
|
|
|
+ $scope.deOrder.entrystatus = '已提交';
|
|
|
|
|
+ $scope.deOrder.totalamount = 0;
|
|
|
|
|
+ $scope.deOrder.usdpayment = 0;
|
|
|
|
|
+ $scope.deOrder.orderamount = 0;
|
|
|
|
|
+ $scope.deOrder.totalpayament = 0;
|
|
|
|
|
+ angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
|
|
+ $scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
});
|
|
});
|
|
|
|
|
+ if($scope.deOrder.deputyOrderItems[0].prodcode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '您还未填写任何商品信息');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
|
|
|
+ if(data.id) {
|
|
|
|
|
+ toaster.pop('success', '提示', '提交成功');
|
|
|
|
|
+ window.location.hash = "#/purc/deputy/"+data.id;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(data.error) {
|
|
|
|
|
+ toaster.pop('error', '提示', '保存失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ }, function(response) {
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -13273,26 +13370,148 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ $scope.checkresult = false;
|
|
|
|
|
+ var checkKeyword = function() {
|
|
|
|
|
+ if($scope.deOrder.madealdate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '主协议签订日期未选择');
|
|
|
|
|
+ } else if($scope.deOrder.madealcode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '主协议签订编号未填写');
|
|
|
|
|
+ } else if ($scope.deOrder.tervendor == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '终端供应商名称未填写');
|
|
|
|
|
+ } else if($scope.deOrder.vendtel == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '电话号码未填写');
|
|
|
|
|
+ } else if($scope.deOrder.venduser == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '联系人未填写');
|
|
|
|
|
+ } else if($scope.deOrder.shipdate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '供应商发货时间未选择');
|
|
|
|
|
+ } else if($scope.deOrder.goodspacking == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '货物包装要求未填写');
|
|
|
|
|
+ } else if($scope.deOrder.deliverymethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '供应商交货方式未填写');
|
|
|
|
|
+ } else if($scope.deOrder.pickupmethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '我方提货方式未填写');
|
|
|
|
|
+ } else if($scope.deOrder.paymentmethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '我方付款方式未填写');
|
|
|
|
|
+ } else if($scope.deOrder.pickupdate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '我方提货时间未选择');
|
|
|
|
|
+ } else if($scope.deOrder.currency == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '交易币别未选择');
|
|
|
|
|
+ } else if($scope.deOrder.deputyuu == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '代采企业未选择');
|
|
|
|
|
+ } else if($scope.deOrder.salecode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单编号未填写');
|
|
|
|
|
+ } else if($scope.deOrder.paydeldate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '我方付款提货时间未选择');
|
|
|
|
|
+ } else if($scope.deOrder.riskmethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '风险承担方式未填写');
|
|
|
|
|
+ } else if($scope.deOrder.taxpaymentmethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '运、税费承担方式');
|
|
|
|
|
+ } else if($scope.deOrder.tervendaddress == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '终端供应商地址未填写');
|
|
|
|
|
+ } else if($scope.deOrder.companyname == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '公司全称(英文)未填写');
|
|
|
|
|
+ } else if($scope.deOrder.requirepaydate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '要求付汇日期未选择');
|
|
|
|
|
+ } else if($scope.deOrder.bankname == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '银行名称(英文)未填写');
|
|
|
|
|
+ } else if($scope.deOrder.bankaccount == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '银行账号未填写');
|
|
|
|
|
+ } else if($scope.deOrder.bankaddress == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '银行地址未填写');
|
|
|
|
|
+ } else if($scope.deOrder.bankcode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '银行代码未填写');
|
|
|
|
|
+ } else if($scope.deOrder.salepocode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '合同编号未填写');
|
|
|
|
|
+ } else if($scope.deOrder.legalrepresent == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '供应商方法定代表人未填写');
|
|
|
|
|
+ } else if($scope.deOrder.paycomname == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '付款公司未填写');
|
|
|
|
|
+ } else if($scope.deOrder.paycomaddress == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '付款公司地址未填写');
|
|
|
|
|
+ } else if($scope.deOrder.enfax == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '供应商方法人电话未填写');
|
|
|
|
|
+ } else if($scope.deOrder.paydate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '货款支付时间未选择');
|
|
|
|
|
+ } else if($scope.deOrder.paymethod == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '货款支付方式未填写');
|
|
|
|
|
+ } else if($scope.deOrder.deliverydate == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '交货时间未选择');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ angular.forEach($scope.deOrder.deputyOrderItems, function(orderitem, index) {
|
|
|
|
|
+ console.log(orderitem);
|
|
|
|
|
+ if(orderitem.prodname == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行产品名称未填写');
|
|
|
|
|
+ } else if(orderitem.prodcode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行产品编号未填写');
|
|
|
|
|
+ } else if(orderitem.prodspec == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行产品规格未填写');
|
|
|
|
|
+ } else if(orderitem.prodbrand == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行产品品牌未填写');
|
|
|
|
|
+ } else if(orderitem.amount == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行数量未填写');
|
|
|
|
|
+ } else if(orderitem.unitprice == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行单价未填写');
|
|
|
|
|
+ } else if(orderitem.purcprice == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '订单明细第'+ (index+1) +'行订单单价未填写');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $scope.checkresult = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 保存
|
|
// 保存
|
|
|
$scope.save = function() {
|
|
$scope.save = function() {
|
|
|
- $scope.deOrder.entrystatus = '保存';
|
|
|
|
|
- $scope.deOrder.totalamount = 0;
|
|
|
|
|
- $scope.deOrder.usdpayment = 0;
|
|
|
|
|
- $scope.deOrder.orderamount = 0;
|
|
|
|
|
- $scope.deOrder.totalpayament = 0;
|
|
|
|
|
- angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
|
|
- $scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
|
|
- });
|
|
|
|
|
- if($scope.deOrder.deputyOrderItems[0].prodcode == null) {
|
|
|
|
|
- toaster.pop('info', '提示', '您还未填写任何商品信息');
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ checkKeyword();
|
|
|
|
|
+ if($scope.checkresult) {
|
|
|
|
|
+ $scope.deOrder.entrystatus = '保存';
|
|
|
|
|
+ $scope.deOrder.totalamount = 0;
|
|
|
|
|
+ $scope.deOrder.usdpayment = 0;
|
|
|
|
|
+ $scope.deOrder.orderamount = 0;
|
|
|
|
|
+ $scope.deOrder.totalpayament = 0;
|
|
|
|
|
+ angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
|
|
+ $scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
|
|
+ });
|
|
|
|
|
+ if($scope.deOrder.deputyOrderItems[0].prodcode == null) {
|
|
|
|
|
+ toaster.pop('info', '提示', '您还未填写任何商品信息');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
|
|
|
+ if(data.id) {
|
|
|
|
|
+ toaster.pop('success', '提示', '保存成功');
|
|
|
|
|
+ loadData();
|
|
|
|
|
+ }
|
|
|
|
|
+ if(data.error) {
|
|
|
|
|
+ toaster.pop('error', '提示', '保存失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ }, function(response) {
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 提交
|
|
|
|
|
+ $scope.submit = function() {
|
|
|
|
|
+ checkKeyword();
|
|
|
|
|
+ if($scope.checkresult) {
|
|
|
|
|
+ $scope.deOrder.entrystatus = '已提交';
|
|
|
|
|
+ $scope.deOrder.totalamount = 0;
|
|
|
|
|
+ $scope.deOrder.usdpayment = 0;
|
|
|
|
|
+ $scope.deOrder.orderamount = 0;
|
|
|
|
|
+ $scope.deOrder.totalpayament = 0;
|
|
|
|
|
+ angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
|
|
+ $scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
|
|
+ });
|
|
|
DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
|
if(data.id) {
|
|
if(data.id) {
|
|
|
- toaster.pop('success', '提示', '保存成功');
|
|
|
|
|
- loadData();
|
|
|
|
|
|
|
+ toaster.pop('success', '提示', '提交成功');
|
|
|
|
|
+ window.location.hash = "#/purc/deputy/"+data.id;
|
|
|
}
|
|
}
|
|
|
if(data.error) {
|
|
if(data.error) {
|
|
|
toaster.pop('error', '提示', '保存失败');
|
|
toaster.pop('error', '提示', '保存失败');
|
|
@@ -13303,32 +13522,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 提交
|
|
|
|
|
- $scope.submit = function() {
|
|
|
|
|
- $scope.deOrder.entrystatus = '已提交';
|
|
|
|
|
- $scope.deOrder.totalamount = 0;
|
|
|
|
|
- $scope.deOrder.usdpayment = 0;
|
|
|
|
|
- $scope.deOrder.orderamount = 0;
|
|
|
|
|
- $scope.deOrder.totalpayament = 0;
|
|
|
|
|
- angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
|
|
- $scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
|
|
- $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
|
|
- });
|
|
|
|
|
- DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
|
|
|
- if(data.id) {
|
|
|
|
|
- toaster.pop('success', '提示', '提交成功');
|
|
|
|
|
- window.location.hash = "#/purc/deputy/"+data.id;
|
|
|
|
|
- }
|
|
|
|
|
- if(data.error) {
|
|
|
|
|
- toaster.pop('error', '提示', '保存失败');
|
|
|
|
|
- }
|
|
|
|
|
- }, function(response) {
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
$scope.openDatePicker = function($event, deOrder, openParam) {
|
|
$scope.openDatePicker = function($event, deOrder, openParam) {
|
|
|
$event.preventDefault();
|
|
$event.preventDefault();
|
|
|
$event.stopPropagation();
|
|
$event.stopPropagation();
|
|
@@ -15964,7 +16157,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
var pageParams = params.url();
|
|
var pageParams = params.url();
|
|
|
pageParams.keyword = $scope.keyword;
|
|
pageParams.keyword = $scope.keyword;
|
|
|
pageParams.searchFilter = $scope.searchFilter;
|
|
pageParams.searchFilter = $scope.searchFilter;
|
|
|
- getService()[$scope.active($scope.getActive)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
|
|
|
|
+ getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
if(page) {
|
|
|
params.total(page.totalElement);
|
|
params.total(page.totalElement);
|