|
|
@@ -394,7 +394,18 @@ define(['app/app'], function (app) {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- })
|
|
|
+ // 循环判断一期都没有付款并且延期的
|
|
|
+ if (data.installmentId && data.installment.status == 503) {
|
|
|
+ angular.forEach(data.installment.installmentDetails, function (detailslist) {
|
|
|
+ var nowTime = new Date();
|
|
|
+ if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
|
|
|
+ data.Overtime = true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 循环判断已付款未收款卖家可取消的
|
|
|
+
|
|
|
+ });
|
|
|
getExMsgState(); // 获取异常消息状态
|
|
|
getReturnByPurchaseIds(); // 获取退货单信息
|
|
|
|
|
|
@@ -531,6 +542,38 @@ define(['app/app'], function (app) {
|
|
|
box.hide();
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ // 取消订单
|
|
|
+ $scope.sellerCancelOrder = function (data, purchaseid) {
|
|
|
+ if(!purchaseid) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ // if (data.installmentId && data.installment.status == 503) {
|
|
|
+ // angular.forEach(data.installment.installmentDetails, function (detailslist) {
|
|
|
+ // var nowTime = new Date();
|
|
|
+ // if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
|
|
|
+ // Purchase.sellerCancelOrder({purchaseId : purchaseid, reason : ''}, null, function () {
|
|
|
+ // toaster.pop('success','取消订单成功');
|
|
|
+ // });
|
|
|
+ // return ;
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ $modal.open({
|
|
|
+ templateUrl: 'static/view/vendor/modal/cancelOrder_modal.html',
|
|
|
+ size : 'md',
|
|
|
+ controller : 'cancelControler',
|
|
|
+ resolve : {
|
|
|
+ purchaseid : function () {
|
|
|
+ return purchaseid;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).result.then(function () {
|
|
|
+ $scope.reload();
|
|
|
+ }, function () {
|
|
|
+ toaster.pop('info', '提示 ' + '您取消了对订单的操作');
|
|
|
+ });
|
|
|
+ };
|
|
|
// 收退货
|
|
|
$scope.receivingDialogShow = {};
|
|
|
// 确认收退货:知道
|
|
|
@@ -1140,6 +1183,9 @@ define(['app/app'], function (app) {
|
|
|
case 501:
|
|
|
result = '待买家付款';
|
|
|
break;
|
|
|
+ case 524:
|
|
|
+ result = '待买家付款';
|
|
|
+ break;
|
|
|
case 504:
|
|
|
result = '付款确认中';
|
|
|
break;
|
|
|
@@ -1171,4 +1217,34 @@ define(['app/app'], function (app) {
|
|
|
return result;
|
|
|
}
|
|
|
});
|
|
|
+ app.register.controller('cancelControler', ['$scope','purchaseid', 'Purchase', '$modalInstance', 'toaster', function ($scope, purchaseid, Purchase, $modalInstance, toaster) {
|
|
|
+
|
|
|
+ $scope.purchase = {};
|
|
|
+ $scope.purchaseid = purchaseid;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 确认取消订单
|
|
|
+ */
|
|
|
+ $scope.confirm = function () {
|
|
|
+ if(!$scope.purchase.reason) {
|
|
|
+ toaster.pop('info','请选择取消订单的原因');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ Purchase.sellerCancelOrder({purchaseId : purchaseid, reason : $scope.purchase.reason}, null, function () {
|
|
|
+ toaster.pop('success','取消订单成功');
|
|
|
+ $modalInstance.close();
|
|
|
+ }, function (res) {
|
|
|
+ console.log(res);
|
|
|
+ toaster.pop('error','取消订单失败,请重新操作');
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 取消操作
|
|
|
+ */
|
|
|
+ $scope.cancel = function () {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ }
|
|
|
+
|
|
|
+ }]);
|
|
|
});
|