Commit bfde79d8 by zhangxw

权益订单新增退单拦截校验

1 parent 7d85d76c
...@@ -80,7 +80,21 @@ ...@@ -80,7 +80,21 @@
} }
} }
$scope.cancelOvertime = function(obj) { $scope.cancelOvertime = async function (obj) {
// 添加理赔过订单退单拦截
let result = await rightInterestService.checkBackOrder({vin: obj.standNo, source: 1}).$promise
if (result.returnCode == '0' && !result.data.allowChargeBack) {
swal({
title: '提示',
type: 'warning',
html: true,
text: '由于您的车辆有理赔案件处理当中,请先联系权益服务官18938907441进行处理',
showCancelButton: true,
showConfirmButton: false,
cancelButtonText: '确定'
})
return
}
swal({ swal({
title: "服务订单已超过七日,确定退单吗?", title: "服务订单已超过七日,确定退单吗?",
type: "warning", type: "warning",
...@@ -471,68 +485,81 @@ ...@@ -471,68 +485,81 @@
// 退单 // 退单
$scope.cancel = function (obj) { $scope.cancel = async function (obj) {
if (obj.equityType == '9' || obj.eqIsGlAcceptance == '1' || obj.eqIsG){ let result = await rightInterestService.checkBackOrder({vin: obj.standNo, source: 1}).$promise
swal({ if (result.returnCode == '0' && !result.data.allowChargeBack) {
title: "确定退保吗?", swal({
type: "warning", title: '提示',
showCancelButton: true, type: 'warning',
confirmButtonColor: "#DD6B55", html: true,
confirmButtonText: "确定", text: '由于您的车辆有理赔案件处理当中,请先联系权益服务官18938907441进行处理',
cancelButtonText: "取消", showCancelButton: true,
closeOnConfirm: false showConfirmButton: false,
}, function () { cancelButtonText: '确定'
var startDate = new Date(obj.successDate); })
var endDate = new Date(); return
var diff = endDate.getTime() - startDate.getTime();//时间差的毫秒数 }
//计算出相差天数 if (obj.equityType == '9' || obj.eqIsGlAcceptance == '1' || obj.eqIsG){
var days = Math.ceil(diff / (24 * 3600 * 1000)); swal({
var che = '1'; title: "确定退保吗?",
if (days > 7) { type: "warning",
swal({ showCancelButton: true,
type: 'error', confirmButtonColor: "#DD6B55",
title: '', confirmButtonText: "确定",
html: true, cancelButtonText: "取消",
text: '为保障客户权益,请邮件主送:service@didihu.com.cn,提交退单申请 ,邮件标题:门店名称+合同号+退单原因,并备注门店接待姓名+电话', closeOnConfirm: false
confirmButtonText: '确定' }, function () {
}) var startDate = new Date(obj.successDate);
} else { var endDate = new Date();
cancelOvertimeEquity(obj) var diff = endDate.getTime() - startDate.getTime();//时间差的毫秒数
} //计算出相差天数
}); var days = Math.ceil(diff / (24 * 3600 * 1000));
} else { var che = '1';
var pdfParam = { if (days > 7) {
'id': obj.id, swal({
'seqNo': obj.seqNo type: 'error',
} title: '',
var config = { html: true,
'title': '退单预览', text: '为保障客户权益,请邮件主送:service@didihu.com.cn,提交退单申请 ,邮件标题:门店名称+合同号+退单原因,并备注门店接待姓名+电话',
'viewUrl': '', confirmButtonText: '确定'
'confirmButtonText': '确认退单', })
'sucMsg': '退单成功', } else {
'failMsg': '退单失败' cancelOvertimeEquity(obj)
} }
var submitParams = { });
'seqNo': obj.seqNo } else {
var pdfParam = {
'id': obj.id,
'seqNo': obj.seqNo
}
var config = {
'title': '退单预览',
'viewUrl': '',
'confirmButtonText': '确认退单',
'sucMsg': '退单成功',
'failMsg': '退单失败'
}
var submitParams = {
'seqNo': obj.seqNo
}
var submitService = 'cancelInsurance';
rightInterestService.print(pdfParam, function (result) {
if(!result.data){
swal({
type: 'error',
title: '退单失败',
html: true,
text: result.message || '',
confirmButtonText: "确定"
});
return;
} }
var submitService = 'cancelInsurance'; config.viewUrl = result.data;
rightInterestService.print(pdfParam, function (result) { equityService.showViewer(pdfParam, submitParams, submitService, config, function () {
if(!result.data){ $scope.search();
swal({
type: 'error',
title: '退单失败',
html: true,
text: result.message || '',
confirmButtonText: "确定"
});
return;
}
config.viewUrl = result.data;
equityService.showViewer(pdfParam, submitParams, submitService, config, function () {
$scope.search();
})
}) })
} })
}
} }
$scope.viewUpdateDetail = function (obj) { $scope.viewUpdateDetail = function (obj) {
......
...@@ -465,6 +465,12 @@ angular ...@@ -465,6 +465,12 @@ angular
url: "equityManage/getLossFreeValueValid", url: "equityManage/getLossFreeValueValid",
method: "GET", method: "GET",
}, },
// 校验是否允许退单
checkBackOrder: {
url: "/equityManage/checkChargeBackAllowed",
method: "POST",
headers: { "Content-type": "application/json" }
}
}); });
}, },
]) ])
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!