Commit bfde79d8 by zhangxw

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

1 parent 7d85d76c
......@@ -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({
title: "服务订单已超过七日,确定退单吗?",
type: "warning",
......@@ -471,68 +485,81 @@
// 退单
$scope.cancel = function (obj) {
if (obj.equityType == '9' || obj.eqIsGlAcceptance == '1' || obj.eqIsG){
swal({
title: "确定退保吗?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnConfirm: false
}, function () {
var startDate = new Date(obj.successDate);
var endDate = new Date();
var diff = endDate.getTime() - startDate.getTime();//时间差的毫秒数
//计算出相差天数
var days = Math.ceil(diff / (24 * 3600 * 1000));
var che = '1';
if (days > 7) {
swal({
type: 'error',
title: '',
html: true,
text: '为保障客户权益,请邮件主送:service@didihu.com.cn,提交退单申请 ,邮件标题:门店名称+合同号+退单原因,并备注门店接待姓名+电话',
confirmButtonText: '确定'
})
} else {
cancelOvertimeEquity(obj)
}
});
} else {
var pdfParam = {
'id': obj.id,
'seqNo': obj.seqNo
}
var config = {
'title': '退单预览',
'viewUrl': '',
'confirmButtonText': '确认退单',
'sucMsg': '退单成功',
'failMsg': '退单失败'
$scope.cancel = 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
}
if (obj.equityType == '9' || obj.eqIsGlAcceptance == '1' || obj.eqIsG){
swal({
title: "确定退保吗?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnConfirm: false
}, function () {
var startDate = new Date(obj.successDate);
var endDate = new Date();
var diff = endDate.getTime() - startDate.getTime();//时间差的毫秒数
//计算出相差天数
var days = Math.ceil(diff / (24 * 3600 * 1000));
var che = '1';
if (days > 7) {
swal({
type: 'error',
title: '',
html: true,
text: '为保障客户权益,请邮件主送:service@didihu.com.cn,提交退单申请 ,邮件标题:门店名称+合同号+退单原因,并备注门店接待姓名+电话',
confirmButtonText: '确定'
})
} else {
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';
rightInterestService.print(pdfParam, function (result) {
if(!result.data){
swal({
type: 'error',
title: '退单失败',
html: true,
text: result.message || '',
confirmButtonText: "确定"
});
return;
}
config.viewUrl = result.data;
equityService.showViewer(pdfParam, submitParams, submitService, config, function () {
$scope.search();
})
config.viewUrl = result.data;
equityService.showViewer(pdfParam, submitParams, submitService, config, function () {
$scope.search();
})
}
})
}
}
$scope.viewUpdateDetail = function (obj) {
......
......@@ -465,6 +465,12 @@ angular
url: "equityManage/getLossFreeValueValid",
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!