|
|
@@ -406,12 +406,15 @@ define(['app/app'], function(app) {
|
|
|
if(!isValid) {
|
|
|
return ;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
// if ($scope.showTip){
|
|
|
// //验证通过后保存卖家输入额外的快递公司名称
|
|
|
// KdnLogistics.saveSellerLogistics({companyName :$scope.logistics.companyName}, {}, function (data) {
|
|
|
// console.log(data);
|
|
|
// });
|
|
|
// }
|
|
|
+
|
|
|
var sendInfo = {};
|
|
|
sendInfo.sendType = $scope.checkinvoice.sendType;
|
|
|
if ($scope.logistics.companyName && $scope.logistics.number){
|
|
|
@@ -419,13 +422,24 @@ define(['app/app'], function(app) {
|
|
|
sendInfo.logisticsInfo.companyName = $scope.logistics.companyName;
|
|
|
sendInfo.logisticsInfo.number = $scope.logistics.number;
|
|
|
}
|
|
|
+ var HasCount = false
|
|
|
var _obj = []
|
|
|
for (var i = 0; i < $scope.checkinvoice.purchaseDetails.length; i++) {
|
|
|
- if (Math.abs($scope.checkinvoice.purchaseDetails[i].sendCount) > 0) {
|
|
|
- var _id = $scope.checkinvoice.purchaseDetails[i].id
|
|
|
- _obj.push({id: _id, qty: $scope.checkinvoice.purchaseDetails[i].sendCount})
|
|
|
- }
|
|
|
+ if (Math.abs($scope.checkinvoice.purchaseDetails[i].sendCount)
|
|
|
+ > 0) {
|
|
|
+ HasCount = true
|
|
|
+ var _id = $scope.checkinvoice.purchaseDetails[i].id
|
|
|
+ _obj.push({
|
|
|
+ id: _id,
|
|
|
+ qty: $scope.checkinvoice.purchaseDetails[i].sendCount
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!HasCount) {
|
|
|
+ toaster.pop("info", "提示", "最少填写一个发货数量");
|
|
|
+ return ;
|
|
|
}
|
|
|
+ // 如果没有输入发货数量,默认是全部发货
|
|
|
sendInfo.map = _obj
|
|
|
// if($scope.checkinvoice.deliveryType == 'logistics') {
|
|
|
// sendInfo.deliveryType = 'logistics';
|
|
|
@@ -731,11 +745,11 @@ define(['app/app'], function(app) {
|
|
|
});
|
|
|
}
|
|
|
// 修改本次发货
|
|
|
- $scope.isSendCount = 0
|
|
|
+ // $scope.isSendCount = 0
|
|
|
// todo 已发货信息到时候需要根据当前对象获取信息
|
|
|
$scope.ChangeSendCount = function(details, val, ind) {
|
|
|
if (val > details.number - details.shipQty) {
|
|
|
- toaster.pop('warning', '提示', '本次发货数量不能大于已够数量')
|
|
|
+ toaster.pop('warning', '提示', '本次发货数量不能大于已剩数量')
|
|
|
val = details.number - details.shipQty
|
|
|
}
|
|
|
$scope.checkinvoice.purchaseDetails[ind].sendCount = val
|